public interface SlotMap extends java.lang.Iterable<Slot>
This class generally has a bit of a strange interface, and its interactions with ScriptableObject are complex. Many attempts to make this interface more elegant have resulted in substantial performance regressions so we are doing the best that we can.
Modifier and Type | Method and Description |
---|---|
void |
add(Slot newSlot)
Insert a new slot to the map.
|
boolean |
isEmpty()
Return whether the map is empty.
|
Slot |
modify(java.lang.Object key,
int index,
int attributes)
Return the Slot that matches EITHER "key" or "index".
|
Slot |
query(java.lang.Object key,
int index)
Retrieve the slot at EITHER key or index, or return null if the slot cannot be found.
|
void |
remove(java.lang.Object key,
int index)
Remove the slot at either "key" or "index".
|
void |
replace(Slot oldSlot,
Slot newSlot)
Replace "slot" with a new slot.
|
int |
size()
Return the size of the map.
|
int size()
boolean isEmpty()
Slot modify(java.lang.Object key, int index, int attributes)
key
- The key for the slot, which should be a String or a Symbol.index
- if key is zero, then this will be used as the key instead.attributes
- the attributes to be set on the slot if a new slot is created. Existing
slots will not be modified.Slot query(java.lang.Object key, int index)
key
- The key for the slot, which should be a String or a Symbol.index
- if key is zero, then this will be used as the key instead.void replace(Slot oldSlot, Slot newSlot)
void add(Slot newSlot)
void remove(java.lang.Object key, int index)
key
- The key for the slot, which should be a String or a Symbol.index
- if key is zero, then this will be used as the key instead.