Class Ref<T extends ACell>

java.lang.Object
convex.core.data.AObject
convex.core.data.Ref<T>
Type Parameters:
T - Type of stored value
All Implemented Interfaces:
IValidated, IWriteable, Comparable<Ref<T>>
Direct Known Subclasses:
RefDirect, RefSoft

public abstract class Ref<T extends ACell> extends AObject implements Comparable<Ref<T>>, IWriteable, IValidated
Class representing a smart reference to a decentralised data value. "The greatest trick the Devil ever pulled was convincing the world he didn’t exist." - The Usual Suspects A Ref itself is not a Cell, but may be contained within a Cell, in which case the Cell class must implement IRefContainer in order to persist and update contained Refs correctly Refs include a status that indicates the level of validation proven. It is important not to rely on the value of a Ref until it has a sufficient status - e.g. a minimum status of PERSISTED is required to be able to guarantee walking an entire nested data structure. Guarantees: - O(1) access to the Hash value, cached on first access - O(1) access to the referenced object (though may required hitting storage if not cached) - Indirectly referenced values may be collected by the garbage collector, with the assumption that they can be retrieved from storage if required