Class OSHDBCombinedIndex<U extends Comparable<U> & Serializable,V extends Comparable<V> & Serializable>

java.lang.Object
org.heigit.ohsome.oshdb.api.generic.OSHDBCombinedIndex<U,V>
Type Parameters:
U - the type of the fist part of the index
V - the type of the second part of the index
All Implemented Interfaces:
Serializable, Comparable<OSHDBCombinedIndex<U,V>>

public class OSHDBCombinedIndex<U extends Comparable<U> & Serializable,V extends Comparable<V> & Serializable> extends Object implements Comparable<OSHDBCombinedIndex<U,V>>, Serializable
A data type for an index ("map key") consisting of two independent variables.
See Also:
  • Constructor Details

    • OSHDBCombinedIndex

      public OSHDBCombinedIndex(U index1, V index2)
  • Method Details

    • getFirstIndex

      public U getFirstIndex()
    • getSecondIndex

      public V getSecondIndex()
    • compareTo

      public int compareTo(@NotNull @NotNull OSHDBCombinedIndex<U,V> other)
      Specified by:
      compareTo in interface Comparable<U extends Comparable<U> & Serializable>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • nest

      public static <A, U extends Comparable<U> & Serializable, V extends Comparable<V> & Serializable> SortedMap<U,SortedMap<V,A>> nest(Map<OSHDBCombinedIndex<U,V>,A> result)
      Helper function that converts the dual-index data structure returned by aggregation operations on this object to a nested Map structure, which can be easier to process further on.

      This version creates a map for each <U> index value, containing maps containing results by timestamps.

      Type Parameters:
      A - an arbitrary data type, used for the data value items
      U - an arbitrary data type, used for the index'es key items
      V - an arbitrary data type, used for the index'es key items
      Parameters:
      result - the "flat" result data structure that should be converted to a nested structure
      Returns:
      a nested data structure: for each index part there is a separate level of nested maps