public static final class FrameDescriptor.Builder extends Object
Modifier and Type | Method and Description |
---|---|
int |
addSlot(FrameSlotKind kind,
Object name,
Object info)
Adds an indexed frame slot to the
FrameDescriptor . |
int |
addSlots(int count,
FrameSlotKind kind)
Adds the given number of consecutive indexed slots to the
FrameDescriptor , and
initializes them with the given kind. |
FrameDescriptor |
build()
Uses the data provided to this builder to create a new
FrameDescriptor . |
FrameDescriptor.Builder |
defaultValue(Object newDefaultValue)
Sets the default value for the frame slots in this frame descriptor.
|
FrameDescriptor.Builder |
info(Object info)
Adds a user-defined info object to the frame descriptor.
|
public FrameDescriptor.Builder defaultValue(Object newDefaultValue)
newDefaultValue
- the default value for the resulting frame descriptorpublic int addSlots(int count, FrameSlotKind kind)
FrameDescriptor
, and
initializes them with the given kind.count
- number of slots to be addedkind
- default type of the newly added frame slotspublic int addSlot(FrameSlotKind kind, Object name, Object info)
FrameDescriptor
. The frame descriptor's
internal arrays for storing name
and info
are allocated only when needed,
so using only null
reduces memory footprint.kind
- default type of the newly added frame slotname
- Name of the newly added frame slot. Can (and should, if possible) be null.info
- Info object for the newly added frame slot. Can (and should, if possible) be
null.public FrameDescriptor.Builder info(Object info)
FrameDescriptor.getInfo()
. They do not influence the semantics of the frame
descriptor in any other way.info
- the user-defined info objectpublic FrameDescriptor build()
FrameDescriptor
.FrameDescriptor