io.realm
Implemented interfaces:
RealmSet is a collection that contains no duplicate elements.Similarly to RealmList s, a RealmSet can operate in managed and unmanaged modes. In managed mode a RealmSet persists all its contents inside a Realm whereas in unmanaged mode it functions like a HashSet .
Managed RealmSets can only be created by Realm and will automatically update their content whenever the underlying Realm is updated. Managed RealmSet can only be accessed using the getter that points to a RealmSet field of a RealmObject .
Unmanaged elements in this set can be added to a Realm using the Realm.copyToRealm(Iterable, ImportFlag...) method.
Warning: the following methods are not supported for classes containing set fields yet:
Realm.createAllFromJson(Class, String)
Realm.createAllFromJson(Class, InputStream)
Realm.createObjectFromJson(Class, String)
Realm.createObjectFromJson(Clase, Flujo de entrada)
Realm.createOrUpdateAllFromJson(Class, String)
Realm.createOrUpdateAllFromJson(Class, InputStream)
Realm.createOrUpdateObjectFromJson(Class, String)
Realm.createOrUpdateObjectFromJson(clase, InputStream)
Constructores
Constructor and Description |
|---|
RealmSet () Instantiates a RealmSet in unmanaged mode. |
Crea una instancia de un RealmSet en modo no administrado con otra colección. |
Instancia un RealmSet en modo gestionado. |
Resumen del método
Modificador y Tipo | Método y descripción |
|---|---|
public booleano | |
public booleano | |
public void | Agrega un escuchador de cambios a este RealmSet . |
public void | Agrega un escuchador de cambios a este RealmSet . |
public double | |
public void | clear () |
public booleano | |
public booleano | |
public booleano | This deletes all objects in the collection from the underlying Realm as well as from the collection. |
public RealmSet | freeze () |
public Class | |
public String | |
public booleano | isEmpty () |
public booleano | isFrozen () |
public booleano | isLoaded () Checks if a collection has finished loading its data yet. |
public booleano | isManaged () Checks if the collection is managed by Realm. |
public booleano | isValid () Checks if the collection is still valid to use, i.e., the io.realm.Realm instance hasn't been closed. |
public Iterator | iterator () |
public booleano | load () Bloquea la recopilación hasta que todos los datos estén disponibles. |
public Number | |
public Date | |
public Number | |
public Date | |
public booleano | |
public booleano | |
public void | Removes all user-defined change listeners. |
public void | Removes the specified change listener. |
public void | Removes the specified change listener. |
public booleano | |
public int | size () |
public Number | |
public T | |
public Object | toArray () |
where () Returns a RealmQuery, which can be used to query for specific objects of this class. |
Inherited Methods
Methods inherited from class java.lang.Object :
getClass,hashCode,equals,clone,toString,notify,notifyAll,wait,wait,wait,finalize
Detalle del constructor
public RealmSet () |
|---|
Instantiates a RealmSet in unmanaged mode. |
Crea una instancia de un RealmSet en modo no administrado con otra colección. Parámetros
|
Crea una instancia de un RealmSet en modo administrado. Realm utiliza este constructor internamente. Parámetros
|
Detalle del método
add
addAll
addChangeListener
Agrega un escuchador de cambios a este RealmSet . Registering a change listener will not prevent the underlying RealmSet from being garbage collected. If the RealmSet is garbage collected, the change listener will stop being triggered. To avoid this, keep a strong reference for as long as appropriate e.g. in a class variable. Parámetros
Throws
|
Agrega un escuchador de cambios a este RealmSet . Registering a change listener will not prevent the underlying RealmSet from being garbage collected. If the RealmSet is garbage collected, the change listener will stop being triggered. To avoid this, keep a strong reference for as long as appropriate e.g. in a class variable. Parámetros
Throws
|
average
Devuelve el promedio de un campo dado. Devuelve el promedio del campo indicado entre los objetos de los resultados de la query. Esto será del tipo double para todos los campos de tipo numérico. Si no existen objetos o todos tienen |
borrar
public void clear () |
|---|
contiene
Tests whether this Devuelve
|
containsAll
deleteAllFromRealm
public boolean deleteAllFromRealm () |
|---|
This deletes all objects in the collection from the underlying Realm as well as from the collection. Devuelve
|
freeze
getValueClass
public Class getValueClass () |
|---|
getValueClassName
public String getValueClassName () |
|---|
isEmpty
public boolean isEmpty () |
|---|
isFrozen
public boolean isFrozen () |
|---|
isLoaded
public boolean isLoaded () |
|---|
Checks if a collection has finished loading its data yet. Devuelve
|
esGestionado
public boolean isManaged () |
|---|
Checks if the collection is managed by Realm. A managed collection is just a wrapper around the data in the underlying Realm file. On Looper threads, a managed collection will be live-updated so it always points to the latest data. Managed collections are thread confined so that they cannot be accessed from other threads than the one that created them.If this method returns Devuelve
|
isValid
public boolean isValid () |
|---|
Checks if the collection is still valid to use, i.e., the io.realm.Realm instance hasn't been closed. It will always return Devuelve
|
iterador
carga
public boolean load () |
|---|
Bloquea la recopilación hasta que todos los datos estén disponibles. Devuelve
|
máximo
fecha máxima
min
minDate
Remover
Remover todo
removeAllChangeListeners
public void removeAllChangeListeners () |
|---|
Removes all user-defined change listeners. Throws
|
removeChangeListener
Removes the specified change listener. Parámetros
Throws
|
Removes the specified change listener. Parámetros
Throws
|
retenerTodo
tamaño
public int size () |
|---|
suma
toArray
dónde
public RealmQuery where () |
|---|
Returns a RealmQuery, which can be used to query for specific objects of this class. Devuelve un objeto de RealmQuery. Throws
|