Class KeyValues

java.lang.Object
com.sparsity.sparksee.gdb.KeyValues
All Implemented Interfaces:
Closeable, AutoCloseable, Iterator<KeyValue>

public class KeyValues extends Object implements Closeable, Iterator<KeyValue>
Value set class.

This is a set of Value instances, that is there is no duplicated elements.

Use a ValuesIterator to traverse all the elements into the set.

When the Values instance is closed, it closes all existing and non-closed ValuesIterator instances too.

Author:
Sparsity Technologies http://www.sparsity-technologies.com
  • Method Details

    • isClosed

      public boolean isClosed()
      Gets if KeyValues instance has been closed or not.

      Returns:
      TRUE if the KeyValues instance has been closed, FALSE otherwise.
      See Also:
    • next

      public KeyValue next()
      Gets the next KeyValue pair.

      Specified by:
      next in interface Iterator<KeyValue>
      Returns:
      Returns the next KeyValue pair
    • next

      public void next(KeyValue kv)
      Gets the next KeyValue pair.

      Parameters:
      kv - Returns the next KeyValue pair
    • hasNext

      public boolean hasNext()
      Checks if the KeyValues has more KeyValue pairs.

      Specified by:
      hasNext in interface Iterator<KeyValue>
      Returns:
      Returns ture if there are more KeyValue pairs
    • close

      public void close()
      Closes the KeyValues instance.

      It must be called to ensure the integrity of all data.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable