| 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.
|
Set<Object> |
getIdentifiers()
Retrieve the list 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 number of slots in the descriptor.
|
List<? extends FrameSlot> |
getSlots()
Current set 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.
|
FrameDescriptor |
shallowCopy()
Shallow copy of the descriptor.
|
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.identifier - key for the slotpublic FrameSlot addFrameSlot(Object identifier, FrameSlotKind kind)
addFrameSlot(identifier, null, kind). This is a slow operation
that switches to interpreter mode.identifier - key for the slotkind - the kind of the new slotpublic FrameSlot addFrameSlot(Object identifier, Object info, FrameSlotKind kind)
FrameDescriptor.getSlots() list. This is a slow operation that switches to
interpreter mode.identifier - key for the slot - it needs proper Object.equals(java.lang.Object) and
Object.hashCode() implementationsinfo - additional information for the slotkind - the kind of the new slotIllegalArgumentException - if a frame slot with the same identifier existspublic FrameSlot findFrameSlot(Object identifier)
identifier - the key of the slot to search fornullpublic FrameSlot findOrAddFrameSlot(Object identifier)
identifier - the key of the slot to search forpublic FrameSlot findOrAddFrameSlot(Object identifier, FrameSlotKind kind)
identifier - the key of the slot to search forkind - the kind for the newly created slotpublic 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 slotpublic void removeFrameSlot(Object identifier)
identifier - identifies the slot to removeIllegalArgumentException - if no such frame slot existspublic int getSize()
FrameDescriptor.getSlots().List.size() would returnpublic List<? extends FrameSlot> getSlots()
FrameSlotpublic Set<Object> getIdentifiers()
public FrameDescriptor copy()
public FrameDescriptor shallowCopy()
change kind of one
of the slots it is changed in the original as well as in the shallow 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