Package ghidra.util.datastruct
Class FullKeySet
java.lang.Object
ghidra.util.datastruct.FullKeySet
- All Implemented Interfaces:
ShortKeySet
,Serializable
Implementation of the ShortKeySet interface that always contains
all the possible keys. Used to save storage when sets are full.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(short key) Determines if a given key is in the set.short
getFirst()
Returns the first (lowest) key in the set.short
getLast()
Returns the last (highest) key in the set.short
getNext
(short key) finds the next key that is in the set that is greater than the given key.short
getPrevious
(short key) finds the previous key that is in the set that is less than the given key.boolean
isEmpty()
Checks if the set is empty.void
put
(short key) Adds a key to the set.boolean
remove
(short key) Removes the key from the set.void
Removes all keys from the set.int
size()
Returns the number of keys currently in the set.
-
Constructor Details
-
FullKeySet
public FullKeySet(int numKeys) Construct a new FullKeySet- Parameters:
numKeys
- the number of keys in the set.
-
-
Method Details
-
size
public int size()Returns the number of keys currently in the set.- Specified by:
size
in interfaceShortKeySet
-
containsKey
public boolean containsKey(short key) Description copied from interface:ShortKeySet
Determines if a given key is in the set.- Specified by:
containsKey
in interfaceShortKeySet
- Parameters:
key
- the key whose presence is to be tested.- Returns:
- true if the key is in the set.
- See Also:
-
getFirst
public short getFirst()Description copied from interface:ShortKeySet
Returns the first (lowest) key in the set.- Specified by:
getFirst
in interfaceShortKeySet
- See Also:
-
getLast
public short getLast()Description copied from interface:ShortKeySet
Returns the last (highest) key in the set.- Specified by:
getLast
in interfaceShortKeySet
- See Also:
-
put
public void put(short key) Description copied from interface:ShortKeySet
Adds a key to the set.- Specified by:
put
in interfaceShortKeySet
- Parameters:
key
- the key to add to the set.- See Also:
-
remove
public boolean remove(short key) Description copied from interface:ShortKeySet
Removes the key from the set.- Specified by:
remove
in interfaceShortKeySet
- Parameters:
key
- the key to remove from the set.- See Also:
-
removeAll
public void removeAll()Description copied from interface:ShortKeySet
Removes all keys from the set.- Specified by:
removeAll
in interfaceShortKeySet
- See Also:
-
getNext
public short getNext(short key) Description copied from interface:ShortKeySet
finds the next key that is in the set that is greater than the given key.- Specified by:
getNext
in interfaceShortKeySet
- Parameters:
key
- the key for which to find the next key after.- See Also:
-
getPrevious
public short getPrevious(short key) Description copied from interface:ShortKeySet
finds the previous key that is in the set that is less than the given key.- Specified by:
getPrevious
in interfaceShortKeySet
- Parameters:
key
- the key for which to find the previous key.- See Also:
-
isEmpty
public boolean isEmpty()Description copied from interface:ShortKeySet
Checks if the set is empty.- Specified by:
isEmpty
in interfaceShortKeySet
- Returns:
- true if the set is empty.
- See Also:
-