Package ghidra.trace.model
Interface Lifespan
- All Known Implementing Classes:
Lifespan.Empty,Lifespan.Impl
public sealed interface Lifespan
extends Span<Long,Lifespan>, Iterable<Long>
permits Lifespan.Empty, Lifespan.Impl
A closed range on snapshot keys, indicating a duration of time
To attempt to avoid overuse of boxed Longs, we add primitive getters for the endpoints
and re-define many of the interfaces' methods to work on those primitives directly. However,
we've not done any performance testing to know whether the juice is worth the squeeze.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAn interval tree implementingLifespan.MutableLifeSetstatic enumThe domain of snapshot keysstatic final classThe singleton empty lifespan of snapshot keysstatic final recordA non-empty lifespan of snapshot keysstatic interfaceA set of lifespansstatic interfaceA mutable set of lifespansNested classes/interfaces inherited from interface generic.Span
Span.DefaultSpanMap<N,S extends Span<N, S>, V>, Span.DefaultSpanSet<N, S extends Span<N, S>>, Span.MutableSpanMap<N, S extends Span<N, S>, V>, Span.MutableSpanSet<N, S extends Span<N, S>>, Span.SpanMap<N, S extends Span<N, S>, V>, Span.SpanMapSetter<E, N, S extends Span<N, S>, V>, Span.SpanSet<N, S extends Span<N, S>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Lifespan.Implstatic final Lifespan.Domainstatic final Lifespan.Empty -
Method Summary
Modifier and TypeMethodDescriptionstatic Lifespanat(long snap) Get the lifespan for only the given snap.static Lifespanbefore(long snap) Get the lifespan that excludes the given and all future snapsbooleancontains(long n) default Lifespan.Domaindomain()Get the domain of this span's endpointsstatic booleanisScratch(long snap) Check if a given snapshot key is designated as scratch spacelonglmax()longlmin()static LifespannowOn(long snap) Get the lifespan from the given snap into the indefinite futurestatic LifespannowOnMaybeScratch(long snap) Get the lifespan from the given snap into the indefinite future, considering scratch spacestatic Lifespansince(long snap) Get the lifespan from 0 to the given snap.static Lifespanspan(long minSnap, long maxSnap) Get the lifespan for the given snap boundsstatic LifespantoNow(long snap) Get the lifespan from the given snap into the indefinite past, including scratchdefault LifespanwithMax(long max) default LifespanwithMin(long min) Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface generic.Span
bound, compareTo, contains, encloses, intersect, intersects, isEmpty, max, maxIsFinite, min, minIsFinite, subtract, toString
-
Field Details
-
DOMAIN
-
EMPTY
-
ALL
-
-
Method Details
-
span
Get the lifespan for the given snap bounds- Parameters:
minSnap- the minimum snapmaxSnap- the maximum snap- Returns:
- the lifespan
-
at
Get the lifespan for only the given snap.- Parameters:
snap- the snapshot key- Returns:
- the lifespan
-
since
Get the lifespan from 0 to the given snap.The lower bound is 0 to exclude scratch space.
- Parameters:
snap- the snapshot key- Returns:
- the lifespan
-
nowOn
Get the lifespan from the given snap into the indefinite future- Parameters:
snap- the snapshot key- Returns:
- the lifespan
-
nowOnMaybeScratch
Get the lifespan from the given snap into the indefinite future, considering scratch spaceIf the snapshot is in scratch space, then the span will have an upper endpoint of -1, the last scratch snapshot. Otherwise, this is the same as
nowOn(long).- Parameters:
snap-- Returns:
- the lifespan
-
isScratch
static boolean isScratch(long snap) Check if a given snapshot key is designated as scratch spaceConventionally, negative snaps are scratch space.
- Parameters:
snap- the snap- Returns:
- true if scratch space
-
toNow
Get the lifespan from the given snap into the indefinite past, including scratch- Parameters:
snap- the snapshot key- Returns:
- the lifespan
-
before
Get the lifespan that excludes the given and all future snaps- Parameters:
snap- the snap- Returns:
- the lifespan
-
domain
Description copied from interface:SpanGet the domain of this span's endpoints -
lmin
long lmin() -
lmax
long lmax() -
contains
boolean contains(long n) -
withMin
-
withMax
-