public interface SlotMap extends 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 | Interface and Description |
|---|---|
static interface |
SlotMap.SlotComputer<S extends Slot> |
| Modifier and Type | Method and Description |
|---|---|
void |
add(SlotMapOwner owner,
Slot newSlot)
Insert a new slot to the map.
|
<S extends Slot> |
compute(SlotMapOwner owner,
Object key,
int index,
SlotMap.SlotComputer<S> compute)
Replace the value of key with the slot computed by the "compute" method.
|
default int |
dirtySize() |
boolean |
isEmpty()
Return whether the map is empty.
|
Slot |
modify(SlotMapOwner owner,
Object key,
int index,
int attributes)
Return the Slot that matches EITHER "key" or "index".
|
Slot |
query(Object key,
int index)
Retrieve the slot at EITHER key or index, or return null if the slot cannot be found.
|
default long |
readLock() |
int |
size()
Return the size of the map.
|
default void |
unlockRead(long stamp) |
forEach, iterator, spliteratorint size()
boolean isEmpty()
Slot modify(SlotMapOwner owner, 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(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.<S extends Slot> S compute(SlotMapOwner owner, Object key, int index, SlotMap.SlotComputer<S> compute)
void add(SlotMapOwner owner, Slot newSlot)
default long readLock()
default void unlockRead(long stamp)
default int dirtySize()
Copyright © 2025 HtmlUnit. All rights reserved.