io.realm
Esta clase contiene todas las coincidencias de una consulta RealmQuery para un dominio determinado. Los objetos no se copian del dominio a la lista RealmResults, sino que se referencian desde RealmResult. Esto ahorra memoria y aumenta la velocidad.
RealmResults are live views, which means that if it is on an Looper thread, it will automatically update its query results after a transaction has been committed. If on a non-looper thread, Realm.refresh() must be called to update the results.
Updates to RealmObjects from a RealmResults list must be done from within a transaction and the modified objects are persisted to the Realm file during the commit of the transaction.
A RealmResults object cannot be passed between different threads.
Tenga en cuenta que un RealmResults nunca es null Ni siquiera si no contiene objetos. Siempre debe usar el método RealmResults.size() para comprobar si un RealmResults está vacío.
If a RealmResults is built on RealmList through RealmList.where() , it will become empty when the source RealmList gets deleted.
RealmResults puede contener más de elementos.Integer.MAX_VALUE En ese caso, solo se puede acceder a los primeros Integer.MAX_VALUE elementos.
Resumen del método
Modificador y Tipo | Método y descripción |
|---|---|
public void | ) Adds a change listener to this RealmResults . |
public void | Adds a change listener to this RealmResults . |
public <any> | Devuelve un Observable Rx que supervisa los cambios en estos RealmResults. |
public <any> | asFlowable () Devuelve un Rx Flowable que supervisa los cambios en estos RealmResults. |
public String | asJSON () Returns a JSON representation of the matches of a RealmQuery . |
public RealmResults | freeze () |
public booleano | isFrozen () |
public booleano | isLoaded () Devuelve |
public booleano | load () Makes an asynchronous query blocking. |
public void | Removes all user-defined change listeners. |
public void | ) Removes the specified change listener. |
public void | Removes the specified change listener. |
public void | |
public void | Sets the |
public void | |
public void | |
public void | Sets the |
public void | |
public void | |
public void | |
public void | Reemplaza el RealmList en el campo dado en todos los objetos de esta colección. |
public void | |
public void | |
public void | Sets a reference to another object on the given field in all of the objects in the collection. |
public void | Sets the |
public void | |
public void | |
public void | |
public void | |
public RealmResults | |
where () Returns a RealmQuery , which can be used to query for specific objects from this collection. |
Inherited Methods
Methods inherited from class java.lang.Object :
getClass,hashCode,equals,clone,toString,notify,notifyAll,wait,wait,wait,finalizeMethods inherited from class java.util.AbstractCollection :
iterator,size,isEmpty,contains,toArray,toArray,add,remove,containsAll,addAll,removeAll,retainAll,clear,toStringMethods inherited from class java.util.AbstractList :
add,get,set,add,remove,indexOf,lastIndexOf,clear,addAll,iterator,listIterator,listIterator,subList,equals,hashCode,removeRangeMethods inherited from class io.realm.OrderedRealmCollectionImpl:
isValid,isManaged,contains,get,first,first,last,last,deleteFromRealm,deleteAllFromRealm,iterator,listIterator,listIterator,sort,sort,sort,sort,size,min,minDate,max,maxDate,sum,average,remove,remove,removeAll,set,retainAll,deleteLastFromRealm,deleteFirstFromRealm,clear,add,add,addAll,addAll,createSnapshot,getRealm,getCollectionOperator
Detalle del método
addChangeListener
public void addChangeListener ( ) | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Adds a change listener to this RealmResults . Registering a change listener will not prevent the underlying RealmResults from being garbage collected. If the RealmResults 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
|
Adds a change listener to this RealmResults . Registering a change listener will not prevent the underlying RealmResults from being garbage collected. If the RealmResults 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
|
asChangesetObservable
public <any> asChangesetObservable () | |||||
|---|---|---|---|---|---|
Returns an Rx Observable that monitors changes to this RealmResults. It will emit the current RealmResults when subscribed. For each update to the RealmResult a pair consisting of the RealmResults and the OrderedCollectionChangeSet will be sent. The changeset will be RealmResults will continually be emitted as the RealmResults are updated - Los elementos emitidos por Realm Observables están congelados (consulta freeze() ). Esto significa que son inmutables y se pueden leer en cualquier hilo. Realm Observables always emit items from the thread holding the live Realm. This means that if you need to do further processing, it is recommend to observe the values on a computation scheduler: Devuelve Observable de RxJava que solo llama a Throws
|
asFlowable
public <any> asFlowable () | |||||||||
|---|---|---|---|---|---|---|---|---|---|
Returns an Rx Flowable that monitors changes to this RealmResults. It will emit the current RealmResults when subscribed to. RealmResults will continually be emitted as the RealmResults are updated - Los elementos emitidos desde Realm Flowables están congelados (ver freeze()). Esto significa que son inmutables y se pueden leer en cualquier hilo. Realm Flowables siempre emite elementos desde el hilo que mantiene los RealmResults en vivo. Esto significa que si necesitas realizar un procesamiento adicional, se recomienda observar los valores en un programador de cálculo: If you would like the Devuelve Observable de RxJava que solo llama a Throws
|
asJSON
Devuelve una representación JSON de las coincidencias de una RealmQuery. Los ciclos se devolverán como índices de fila. Este método auxiliar se utiliza para inspeccionar datos o, para fines de depuración, podría extraer una cadena larga, lo que podría causar un error de memoria insuficiente. Devuelve string representation of a JSON array containing entries of the resulting RealmQuery . |
freeze
public RealmResults freeze () |
|---|
isFrozen
public boolean isFrozen () |
|---|
isLoaded
public boolean isLoaded () |
|---|
Devuelve Devuelve
|
carga
public boolean load () |
|---|
Makes an asynchronous query blocking. This will also trigger any registered RealmChangeListener when the query completes. Devuelve
|
removeAllChangeListeners
public void removeAllChangeListeners () |
|---|
Removes all user-defined change listeners. Throws
|
removeChangeListener
public void removeChangeListener ( ) |
|---|
Removes the specified change listener. Parámetros
Throws
|
Removes the specified change listener. Parámetros
Throws
|
setBlob
Sets the binary value of the given field in all of the objects in the collection. Parámetros
Throws
|
setBoolean
Sets the Parámetros
Throws
|
setByte
Sets the Parámetros
Throws
|
setDate
Sets the Parámetros
Throws
|
setDecimal128
Sets the Parámetros
Throws
|
setDouble
Sets the Parámetros
Throws
|
setFloat
Sets the Parámetros
Throws
|
setInt
Sets the Parámetros
Throws
|
setList
Reemplaza el RealmList en el campo dado en todos los objetos de esta colección. Parámetros
Throws
|
setLong
Sets the Parámetros
Throws
|
setNull
Establece el valor en Parámetros
Throws
|
setObject
Sets a reference to another object on the given field in all of the objects in the collection. Parámetros
Throws
|
setObjectId
Sets the Parámetros
Throws
|
setShort
Sets the Parámetros
Throws
|
setString
Sets the Parámetros
Throws
|
setUUID
Sets the Parámetros
Throws
|
setValue
Updates the field given by Este método intentará automáticamente convertir números y booleanos que se entregan como Using the typed setters like setInt(String, int) will be faster than using this method. Parámetros
Throws
|
sort
Ordena una colección en función de los campos y órdenes de clasificación enviados. Devuelve se creará y devolverá un nuevo RealmResults ordenado. La colección original permanece sin cambios. Anulaciones
|
dónde
public RealmQuery where () |
|---|
Returns a RealmQuery , which can be used to query for specific objects from this collection. Devuelve un objeto de RealmQuery. |