Package ghidra.util.datastruct
Class FullKeySet
- java.lang.Object
-
- ghidra.util.datastruct.FullKeySet
-
- All Implemented Interfaces:
ShortKeySet
,java.io.Serializable
public class FullKeySet extends java.lang.Object implements ShortKeySet, java.io.Serializable
Implementation of the ShortKeySet interface that always contains all the possible keys. Used to save storage when sets are full.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FullKeySet(int numKeys)
Construct a new FullKeySet
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
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
removeAll()
Removes all keys from the set.int
size()
Returns the number of keys currently in the set.
-
-
-
Method Detail
-
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:
ShortKeySet.containsKey(short)
-
getFirst
public short getFirst()
Description copied from interface:ShortKeySet
Returns the first (lowest) key in the set.- Specified by:
getFirst
in interfaceShortKeySet
- See Also:
ShortKeySet.getFirst()
-
getLast
public short getLast()
Description copied from interface:ShortKeySet
Returns the last (highest) key in the set.- Specified by:
getLast
in interfaceShortKeySet
- See Also:
ShortKeySet.getLast()
-
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:
ShortKeySet.put(short)
-
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:
ShortKeySet.remove(short)
-
removeAll
public void removeAll()
Description copied from interface:ShortKeySet
Removes all keys from the set.- Specified by:
removeAll
in interfaceShortKeySet
- See Also:
ShortKeySet.removeAll()
-
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:
ShortKeySet.getNext(short)
-
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:
ShortKeySet.getPrevious(short)
-
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:
ShortKeySet.isEmpty()
-
-