Modifier and Type | Class and Description |
---|---|
static class |
FrameDescriptor.Builder
Builder API for frame descriptors with indexed slots.
|
Constructor and Description |
---|
FrameDescriptor()
Constructs empty descriptor.
|
FrameDescriptor(Object defaultValue)
Constructs new descriptor with specified
FrameDescriptor.getDefaultValue() . |
Modifier and Type | Method and Description |
---|---|
FrameDescriptor |
copy()
Deeper copy of the descriptor.
|
void |
disableAuxiliarySlot(Object key)
Disables the auxiliary slot with the given key, so that subsequently created
Frame
instances may avoid allocating storage for it. |
int |
findOrAddAuxiliarySlot(Object key)
Find or adds an auxiliary slot to this frame descriptor.
|
Map<Object,Integer> |
getAuxiliarySlots()
Returns all currently active auxiliary slots along with their indexes.
|
Object |
getDefaultValue()
Default value for the created slots.
|
Object |
getInfo() |
int |
getNumberOfAuxiliarySlots() |
int |
getNumberOfSlots() |
Object |
getSlotInfo(int slot)
Queries the info object for a given indexed slot.
|
FrameSlotKind |
getSlotKind(int slot)
Returns the
FrameSlotKind associated with the given indexed slot. |
Object |
getSlotName(int slot)
Queries the name for a given indexed slot.
|
static FrameDescriptor.Builder |
newBuilder()
Builds a new frame descriptor with index-based frame slots.
|
static FrameDescriptor.Builder |
newBuilder(int capacity)
Builds a new frame descriptor with index-based frame slots.
|
void |
setSlotKind(int slot,
FrameSlotKind kind)
Sets the
FrameSlotKind of the given indexed slot. |
String |
toString() |
public FrameDescriptor()
FrameDescriptor.getDefaultValue()
is null
.public FrameDescriptor(Object defaultValue)
FrameDescriptor.getDefaultValue()
.defaultValue
- to be returned from FrameDescriptor.getDefaultValue()
public FrameDescriptor copy()
public Object getDefaultValue()
FrameDescriptor.FrameDescriptor(java.lang.Object)
public int getNumberOfSlots()
public FrameSlotKind getSlotKind(int slot)
FrameSlotKind
associated with the given indexed slot.slot
- index of the slotFrameSlotKind
public void setSlotKind(int slot, FrameSlotKind kind)
FrameSlotKind
of the given indexed slot.slot
- index of the slotkind
- new non-null FrameSlotKind
public Object getSlotName(int slot)
slot
- index of the slotnull
)public Object getSlotInfo(int slot)
slot
- index of the slotnull
)public int findOrAddAuxiliarySlot(Object key)
key
- used as a hash map entrypublic void disableAuxiliarySlot(Object key)
Frame
instances may avoid allocating storage for it. Depending on the internal storage layout, it
may not be possible to remove the storage for individual slots, so it is important to disable
_all_ unused slots.key
- the key, as passed to FrameDescriptor.findOrAddAuxiliarySlot(Object)
public Map<Object,Integer> getAuxiliarySlots()
public int getNumberOfAuxiliarySlots()
public Object getInfo()
public static FrameDescriptor.Builder newBuilder()
public static FrameDescriptor.Builder newBuilder(int capacity)
capacity
- the expected number of index-based frame slots (taken as a hint when
allocating internal data structures)