Package ghidra.util.datastruct

# Class FullKeySet

java.lang.Object
ghidra.util.datastruct.FullKeySet

All Implemented Interfaces:
  `ShortKeySet`, `Serializable`

public class FullKeySet extends Object implements ShortKeySet, 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

  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.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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 interface `ShortKeySet`

  - ### containsKey

    public boolean containsKey(short key)
    Description copied from interface: `ShortKeySet`
    Determines if a given key is in the set.
    Specified by:
      `containsKey` in interface `ShortKeySet`
    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 interface `ShortKeySet`
    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 interface `ShortKeySet`
    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 interface `ShortKeySet`
    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 interface `ShortKeySet`
    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 interface `ShortKeySet`
    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 interface `ShortKeySet`
    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 interface `ShortKeySet`
    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 interface `ShortKeySet`
    Returns:
      true if the set is empty.
    See Also:
      - `ShortKeySet.isEmpty()`