Class OIndexOneValue

java.lang.Object
com.orientechnologies.orient.core.index.OIndexAbstract
com.orientechnologies.orient.core.index.OIndexOneValue
All Implemented Interfaces:
OIndex, OIndexInternal, Comparable<OIndex>
Direct Known Subclasses:
OIndexDictionary, OIndexUnique

public abstract class OIndexOneValue extends OIndexAbstract
Abstract Index implementation that allows only one value for a key.
Author:
Luca Garulli
  • Constructor Details

  • Method Details

    • get

      @Deprecated public Object get(Object key)
      Deprecated.
      Description copied from interface: OIndex
      Gets the set of records associated with the passed key.
      Parameters:
      key - The key to search
      Returns:
      The Record set if found, otherwise an empty Set
    • getRidsIgnoreTx

      public Stream<ORID> getRidsIgnoreTx(Object key)
    • getRids

      public Stream<ORID> getRids(Object key)
    • streamEntries

      public Stream<ORawPair<Object,ORID>> streamEntries(Collection<?> keys, boolean ascSortOrder)
      Description copied from interface: OIndexInternal
      Returns stream which presents data associated with passed in keys.
      Parameters:
      keys - Keys data of which should be returned.
      ascSortOrder - Flag which determines whether data iterated by stream should be in ascending or descending order.
      Returns:
      stream which presents data associated with passed in keys.
    • streamEntriesBetween

      public Stream<ORawPair<Object,ORID>> streamEntriesBetween(Object fromKey, boolean fromInclusive, Object toKey, boolean toInclusive, boolean ascOrder)
      Description copied from interface: OIndexInternal
      Returns stream which presents subset of index data between passed in keys.
      Parameters:
      fromKey - Lower border of index data.
      fromInclusive - Indicates whether lower border should be inclusive or exclusive.
      toKey - Upper border of index data.
      toInclusive - Indicates whether upper border should be inclusive or exclusive.
      ascOrder - Flag which determines whether data iterated by stream should be in ascending or descending order.
      Returns:
      Cursor which presents subset of index data between passed in keys.
    • streamEntriesMajor

      public Stream<ORawPair<Object,ORID>> streamEntriesMajor(Object fromKey, boolean fromInclusive, boolean ascOrder)
      Description copied from interface: OIndexInternal
      Returns stream which presents subset of data which associated with key which is greater than passed in key.
      Parameters:
      fromKey - Lower border of index data.
      fromInclusive - Indicates whether lower border should be inclusive or exclusive.
      ascOrder - Flag which determines whether data iterated by stream should be in ascending or descending order.
      Returns:
      stream which presents subset of data which associated with key which is greater than passed in key.
    • streamEntriesMinor

      public Stream<ORawPair<Object,ORID>> streamEntriesMinor(Object toKey, boolean toInclusive, boolean ascOrder)
      Description copied from interface: OIndexInternal
      Returns stream which presents subset of data which associated with key which is less than passed in key.
      Parameters:
      toKey - Upper border of index data.
      toInclusive - Indicates Indicates whether upper border should be inclusive or exclusive.
      ascOrder - Flag which determines whether data iterated by stream should be in ascending or descending order.
      Returns:
      stream which presents subset of data which associated with key which is less than passed in key.
    • size

      public long size()
      Returns:
      number of entries in the index.
    • stream

      public Stream<ORawPair<Object,ORID>> stream()
    • descStream

      public Stream<ORawPair<Object,ORID>> descStream()
    • isUnique

      public boolean isUnique()
      Specified by:
      isUnique in interface OIndex
      Overrides:
      isUnique in class OIndexAbstract
    • calculateTxIndexEntry

      public ORawPair<Object,ORID> calculateTxIndexEntry(Object key, ORID backendValue, OTransactionIndexChanges indexChanges)
    • put

      public OIndexOneValue put(Object key, OIdentifiable value)
      Description copied from interface: OIndex
      Inserts a new entry in the index. The behaviour depends by the index implementation.
      Parameters:
      key - Entry's key
      value - Entry's value as OIdentifiable instance
      Returns:
      The index instance itself to allow in chain calls
    • getUniqueValidator

      public abstract IndexEngineValidator<Object,ORID> getUniqueValidator()