Package org.eclipse.handly.snapshot
Class Snapshot
java.lang.Object
org.eclipse.handly.snapshot.Snapshot
- All Implemented Interfaces:
ISnapshot
- Direct Known Subclasses:
DocumentSnapshot
,NonExpiringSnapshot
,TextFileBufferSnapshot
,TextFileSnapshot
,TextFileStoreSnapshot
Abstract superclass of all snapshots.
Implements an equivalence relation on snapshots.
-
Constructor Details
-
Snapshot
public Snapshot()
-
-
Method Details
-
isEqualTo
Description copied from interface:ISnapshot
Indicates whether some other snapshot is "equal to" this one.If snapshots are equal they have equal contents (or had had equal contents before one or both of them expired). However, the converse is not necessarily true.
Note that snapshots which are equal but not identical may become unequal when one or both of them expire, and may become equal again in case they return to the valid (unexpired) state.
Implementations of this method must be reflexive, symmetric and transitive on non-null references.
-
predictEquality
Predicts whether this snapshot isequal
to the given snapshot without actually obtaining snapshotcontents
. Must returnnull
if cannot tell for sure. Any non-null result must meet the contract ofISnapshot.isEqualTo(ISnapshot)
.- Parameters:
other
- the other snapshot (notnull
and not identical to the receiver)- Returns:
true
if the snapshots are predicted to be equal,false
if the snapshots are predicted to be unequal, andnull
if there is no prediction
-