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
public abstract class Snapshot extends java.lang.Object implements ISnapshot
Abstract superclass of all snapshots. Implements an equivalence relation on snapshots.
-
-
Constructor Summary
Constructors Constructor Description Snapshot()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isEqualTo(ISnapshot other)
Indicates whether some other snapshot is "equal to" this one.protected java.lang.Boolean
predictEquality(Snapshot other)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.handly.snapshot.ISnapshot
getContents
-
-
-
-
Method Detail
-
isEqualTo
public final boolean isEqualTo(ISnapshot other)
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
protected java.lang.Boolean predictEquality(Snapshot other)
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
-
-