Package io.realm
Interface OrderedCollectionChangeSet
-
public interface OrderedCollectionChangeSet
This interface describes the changes made to a collection during the last update.OrderedCollectionChangeSet
is passed to theOrderedRealmCollectionChangeListener
which is registered byRealmResults.addChangeListener(OrderedRealmCollectionChangeListener)
.The change information is available in two formats: a simple array of row indices in the collection for each type of change, or an array of
OrderedCollectionChangeSet.Range
s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
OrderedCollectionChangeSet.Range
static class
OrderedCollectionChangeSet.State
State describing the nature of the changeset.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OrderedCollectionChangeSet.Range[]
getChangeRanges()
The modified ranges of objects in the new version of the collection.int[]
getChanges()
The modified indices in the new version of the collection.OrderedCollectionChangeSet.Range[]
getDeletionRanges()
The deleted ranges of objects in the previous version of the collection.int[]
getDeletions()
The deleted indices in the previous version of the collection.Throwable
getError()
Returns any error that happened.OrderedCollectionChangeSet.Range[]
getInsertionRanges()
The inserted ranges of objects in the new version of the collection.int[]
getInsertions()
The inserted indices in the new version of the collection.OrderedCollectionChangeSet.State
getState()
Returns the state represented by this change.
-
-
-
Method Detail
-
getState
OrderedCollectionChangeSet.State getState()
Returns the state represented by this change. SeeOrderedCollectionChangeSet.State
for a description of the different states a changeset can be in.- Returns:
- what kind of state is represented by this changeset.
- See Also:
OrderedCollectionChangeSet.State
-
getDeletions
int[] getDeletions()
The deleted indices in the previous version of the collection.- Returns:
- the indices array. A zero-sized array will be returned if no objects were deleted.
-
getInsertions
int[] getInsertions()
The inserted indices in the new version of the collection.- Returns:
- the indices array. A zero-sized array will be returned if no objects were inserted.
-
getChanges
int[] getChanges()
The modified indices in the new version of the collection.For
RealmResults
, this means that one or more of the properties of the object at the given index were modified (or an object linked to by that object was modified).- Returns:
- the indices array. A zero-sized array will be returned if objects were modified.
-
getDeletionRanges
OrderedCollectionChangeSet.Range[] getDeletionRanges()
The deleted ranges of objects in the previous version of the collection.- Returns:
- the
OrderedCollectionChangeSet.Range
array. A zero-sized array will be returned if no objects were deleted.
-
getInsertionRanges
OrderedCollectionChangeSet.Range[] getInsertionRanges()
The inserted ranges of objects in the new version of the collection.- Returns:
- the
OrderedCollectionChangeSet.Range
array. A zero-sized array will be returned if no objects were inserted.
-
getChangeRanges
OrderedCollectionChangeSet.Range[] getChangeRanges()
The modified ranges of objects in the new version of the collection.- Returns:
- the
OrderedCollectionChangeSet.Range
array. A zero-sized array will be returned if no objects were modified.
-
getError
@Nullable Throwable getError()
Returns any error that happened. If an error has happened, the state of the collection and other changeset information is undefined. It is possible for a collection to go into an error state after being created and starting to send updates.- Returns:
- the error that happened.
-
-