Interface RealmCollection
On this page
io.realm
Implemented interfaces:
RealmCollection
is the root of the collection hierarchy that Realm supports. It defines operations on data collections and the behavior that they will have in all implementations of RealmCollection
s.
Realm collections are "live" views to the underlying data. This means that they automatically will be kept up to date. As a consequence, using methods like Collections.unmodifiableCollection(Collection) will not prevent a collection from being modified.
Method Summary
Modifier and Type | Method and Description |
---|---|
public double | |
public boolean | |
public boolean | This deletes all objects in the collection from the underlying Realm as well as from the collection. |
public boolean | isLoaded () Checks if a collection has finished loading its data yet. |
public boolean | isManaged () Checks if the collection is managed by Realm. |
public boolean | isValid () Checks if the collection is still valid to use, i.e., the io.realm.Realm instance hasn't been closed. |
public boolean | load () Blocks the collection until all data are available. |
public Number | |
public Date | |
public Number | |
public Date | |
public Number | |
public RealmQuery | where () Returns a RealmQuery , which can be used to query for specific objects from this collection. |
Inherited Methods
Method Detail
average
Returns the average of a given field. Parameters
Returns the average for the given field amongst objects in query results. This will be of type double for all types of number fields. If no objects exist or they all have Throws
|
contains
Tests whether this Parameters
Returns
Throws
|
deleteAllFromRealm
public boolean deleteAllFromRealm () |
---|
This deletes all objects in the collection from the underlying Realm as well as from the collection. Returns
Throws
|
isLoaded
public boolean isLoaded () |
---|
Checks if a collection has finished loading its data yet. Returns
|
isManaged
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 Returns
|
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 Returns
|
load
public boolean load () |
---|
Blocks the collection until all data are available. Returns
|
max
Finds the maximum value of a field. Parameters
Returns if no objects exist or they all have Throws
|
maxDate
Finds the maximum date. Parameters
Returns if no objects exist or they all have Throws
|
min
Finds the minimum value of a field. Parameters
Returns if no objects exist or they all have Throws
|
minDate
Finds the minimum date. Parameters
Returns if no objects exist or they all have Throws
|
sum
Calculates the sum of a given field. Parameters
Returns the sum. If no objects exist or they all have Throws
|
where
public RealmQuery where () |
---|
Returns a RealmQuery , which can be used to query for specific objects from this collection. Returns a RealmQuery object. Throws
|