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 booleancontainsKey(short key)Determines if a given key is in the set.shortgetFirst()Returns the first (lowest) key in the set.shortgetLast()Returns the last (highest) key in the set.shortgetNext(short key)finds the next key that is in the set that is greater than the given key.shortgetPrevious(short key)finds the previous key that is in the set that is less than the given key.booleanisEmpty()Checks if the set is empty.voidput(short key)Adds a key to the set.booleanremove(short key)Removes the key from the set.voidremoveAll()Removes all keys from the set.intsize()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:
sizein interfaceShortKeySet
-
containsKey
public boolean containsKey(short key)
Description copied from interface:ShortKeySetDetermines if a given key is in the set.- Specified by:
containsKeyin 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:ShortKeySetReturns the first (lowest) key in the set.- Specified by:
getFirstin interfaceShortKeySet- See Also:
ShortKeySet.getFirst()
-
getLast
public short getLast()
Description copied from interface:ShortKeySetReturns the last (highest) key in the set.- Specified by:
getLastin interfaceShortKeySet- See Also:
ShortKeySet.getLast()
-
put
public void put(short key)
Description copied from interface:ShortKeySetAdds a key to the set.- Specified by:
putin 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:ShortKeySetRemoves the key from the set.- Specified by:
removein interfaceShortKeySet- Parameters:
key- the key to remove from the set.- See Also:
ShortKeySet.remove(short)
-
removeAll
public void removeAll()
Description copied from interface:ShortKeySetRemoves all keys from the set.- Specified by:
removeAllin interfaceShortKeySet- See Also:
ShortKeySet.removeAll()
-
getNext
public short getNext(short key)
Description copied from interface:ShortKeySetfinds the next key that is in the set that is greater than the given key.- Specified by:
getNextin 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:ShortKeySetfinds the previous key that is in the set that is less than the given key.- Specified by:
getPreviousin 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:ShortKeySetChecks if the set is empty.- Specified by:
isEmptyin interfaceShortKeySet- Returns:
- true if the set is empty.
- See Also:
ShortKeySet.isEmpty()
-
-