Constructor and Description |
---|
FrameDescriptor()
Constructs empty descriptor.
|
FrameDescriptor(Object defaultValue)
Constructs new descriptor with specified
FrameDescriptor.getDefaultValue() . |
Modifier and Type | Method and Description |
---|---|
FrameSlot |
addFrameSlot(Object identifier)
Adds frame slot.
|
FrameSlot |
addFrameSlot(Object identifier,
FrameSlotKind kind)
Adds frame slot.
|
FrameSlot |
addFrameSlot(Object identifier,
Object info,
FrameSlotKind kind)
Adds new frame slot to
FrameDescriptor.getSlots() list. |
FrameDescriptor |
copy()
Deeper copy of the descriptor.
|
FrameSlot |
findFrameSlot(Object identifier)
Finds an existing slot.
|
FrameSlot |
findOrAddFrameSlot(Object identifier)
Finds an existing slot or creates new one.
|
FrameSlot |
findOrAddFrameSlot(Object identifier,
FrameSlotKind kind)
Finds an existing slot or creates new one.
|
FrameSlot |
findOrAddFrameSlot(Object identifier,
Object info,
FrameSlotKind kind)
Finds an existing slot or creates new one.
|
Object |
getDefaultValue()
Default value for the created slots.
|
FrameSlotKind |
getFrameSlotKind(FrameSlot frameSlot)
Kind of the provided slot.
|
Set<Object> |
getIdentifiers()
Retrieve the current set of all the identifiers associated with this frame descriptor.
|
Assumption |
getNotInFrameAssumption(Object identifier)
Make an assumption that no slot with the specified identifier is present in this frame
descriptor.
|
int |
getSize()
Returns the size of an array which is needed for storing all the frame slots.
|
List<? extends FrameSlot> |
getSlots()
Retrieve the current list of slots in the descriptor.
|
Assumption |
getVersion()
Returns an assumption reflecting the frame's current version, which is updated every time a
slot is added or removed, or an existing slot's kind is changed.
|
void |
removeFrameSlot(Object identifier)
Removes a slot.
|
void |
setFrameSlotKind(FrameSlot frameSlot,
FrameSlotKind kind)
Changes the kind of the provided slot.
|
String |
toString() |
public FrameDescriptor()
FrameDescriptor.getDefaultValue()
is null
.public FrameDescriptor(Object defaultValue)
FrameDescriptor.getDefaultValue()
.defaultValue
- to be returned from FrameDescriptor.getDefaultValue()
public FrameSlot addFrameSlot(Object identifier)
addFrameSlot
(identifier, null
, FrameSlotKind.Illegal
). This is a slow operation that
switches to interpreter mode. Note that even if it is checked that the FrameDescriptor does
not have the slot for a given identifier before adding the slot for the given identifier it
can still fail with an IllegalArgumentException
since the FrameDescriptor can be
modified concurrently. In such case consider using FrameDescriptor.findOrAddFrameSlot(Object)
instead.identifier
- key for the slot - must not be null
and needs proper
Object.equals(java.lang.Object)
and Object.hashCode()
implementationsIllegalArgumentException
- if a frame slot with the same identifier existsNullPointerException
- if identifier
is null
public FrameSlot addFrameSlot(Object identifier, FrameSlotKind kind)
addFrameSlot
(identifier, null
, kind
). This is a slow operation that switches to
interpreter mode. Note that even if it is checked that the FrameDescriptor does not have the
slot for a given identifier before adding the slot for the given identifier it can still fail
with an IllegalArgumentException
since the FrameDescriptor can be modified
concurrently. In such case consider using FrameDescriptor.findOrAddFrameSlot(Object, FrameSlotKind)
instead.identifier
- key for the slot - must not be null
and needs proper
Object.equals(java.lang.Object)
and Object.hashCode()
implementationskind
- the kind of the new slotIllegalArgumentException
- if a frame slot with the same identifier existsNullPointerException
- if identifier
or kind
is null
public FrameSlot addFrameSlot(Object identifier, Object info, FrameSlotKind kind)
FrameDescriptor.getSlots()
list. This is a slow operation that switches to
interpreter mode. Note that even if it is checked that the FrameDescriptor does not have the
slot for a given identifier before adding the slot for the given identifier it can still fail
with an IllegalArgumentException
since the FrameDescriptor can be modified
concurrently. In such case consider using
FrameDescriptor.findOrAddFrameSlot(Object, Object, FrameSlotKind)
instead.identifier
- key for the slot - must not be null
and needs proper
Object.equals(java.lang.Object)
and Object.hashCode()
implementationsinfo
- additional information for the slot, may be nullkind
- the kind of the new slotIllegalArgumentException
- if a frame slot with the same identifier existsNullPointerException
- if identifier
or kind
is null
public FrameSlot findFrameSlot(Object identifier)
identifier
- the key of the slot to search fornull
public FrameSlot findOrAddFrameSlot(Object identifier)
identifier
- the key of the slot to search forNullPointerException
- if identifier
is null
public FrameSlot findOrAddFrameSlot(Object identifier, FrameSlotKind kind)
identifier
- the key of the slot to search forkind
- the kind for the newly created slotNullPointerException
- if identifier
or kind
is null
public FrameSlot findOrAddFrameSlot(Object identifier, Object info, FrameSlotKind kind)
identifier
- the key of the slot to search forinfo
- info for the newly created slotkind
- the kind for the newly created slotNullPointerException
- if identifier
or kind
is null
public void removeFrameSlot(Object identifier)
identifier
- identifies the slot to removeIllegalArgumentException
- if no such frame slot existspublic FrameSlotKind getFrameSlotKind(FrameSlot frameSlot)
creation
time
or updated via FrameDescriptor.setFrameSlotKind(FrameSlot, FrameSlotKind)
method.frameSlot
- the slotpublic void setFrameSlotKind(FrameSlot frameSlot, FrameSlotKind kind)
this descriptor
.frameSlot
- the slotkind
- new kind of the slotpublic int getSize()
public List<? extends FrameSlot> getSlots()
FrameSlot
public Set<Object> getIdentifiers()
public FrameDescriptor copy()
public Assumption getVersion()
public Object getDefaultValue()
FrameDescriptor.FrameDescriptor(java.lang.Object)
public Assumption getNotInFrameAssumption(Object identifier)
identifier
- frame slot identifierIllegalArgumentException
- if the frame descriptor contains a slot with the identifier