public final class Assumptions extends Object implements Iterable<Assumptions.Assumption>
Modifier and Type | Class and Description |
---|---|
static class |
Assumptions.Assumption
Abstract base class for assumptions.
|
static class |
Assumptions.AssumptionResult<T>
A class for providing information that is only valid in association with a set of
Assumptions.Assumption s. |
static class |
Assumptions.CallSiteTargetValue
An assumption that a given call site's method handle did not change.
|
static class |
Assumptions.ConcreteMethod
An assumption that a given virtual method has a given unique implementation.
|
static class |
Assumptions.ConcreteSubtype
An assumption that a given abstract or interface type has one direct concrete subtype.
|
static class |
Assumptions.LeafType
An assumption that a given type has no subtypes.
|
static class |
Assumptions.NoFinalizableSubclass
An assumption that a given class has no subclasses implementing
Object.finalize() ). |
Modifier and Type | Field and Description |
---|---|
private Set<Assumptions.Assumption> |
assumptions |
Constructor and Description |
---|
Assumptions() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
isEmpty()
Returns whether any assumptions have been registered.
|
Iterator<Assumptions.Assumption> |
iterator() |
void |
record(Assumptions.Assumption assumption) |
void |
record(Assumptions.AssumptionResult<?> result) |
void |
record(Assumptions other)
Copies assumptions recorded by another
Assumptions object into this object. |
void |
recordConcreteMethod(ResolvedJavaMethod method,
ResolvedJavaType context,
ResolvedJavaMethod impl)
Records that
impl is the only possible concrete target for a virtual call to
method with a receiver of type context . |
void |
recordConcreteSubtype(ResolvedJavaType context,
ResolvedJavaType subtype)
Records that
subtype is the only concrete subtype in the class hierarchy below
context . |
void |
recordNoFinalizableSubclassAssumption(ResolvedJavaType receiverType)
Records an assumption that the specified type has no finalizable subclasses.
|
Assumptions.Assumption[] |
toArray()
Gets a copy of the assumptions recorded in this object as an array.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
private final Set<Assumptions.Assumption> assumptions
public Assumptions()
public boolean isEmpty()
true
if at least one assumption has been registered, false
otherwise.public Iterator<Assumptions.Assumption> iterator()
iterator
in interface Iterable<Assumptions.Assumption>
public void recordNoFinalizableSubclassAssumption(ResolvedJavaType receiverType)
receiverType
- the type that is assumed to have no finalizable subclassespublic void recordConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype)
subtype
is the only concrete subtype in the class hierarchy below
context
.context
- the root of the subtree of the class hierarchy that this assumptions is aboutsubtype
- the one concrete subtypepublic void recordConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl)
impl
is the only possible concrete target for a virtual call to
method
with a receiver of type context
.method
- a method that is the target of a virtual callcontext
- the receiver type of a call to method
impl
- the concrete method that is the only possible target for the virtual callpublic void record(Assumptions.AssumptionResult<?> result)
public void record(Assumptions.Assumption assumption)
public Assumptions.Assumption[] toArray()
public void record(Assumptions other)
Assumptions
object into this object.