Class SegmentAxis


  • public class SegmentAxis
    extends java.lang.Object
    Collection of values of one of the columns that parameterizes a Segment.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) StarColumnPredicate predicate
      Constraint on the keys in this Axis.
    • Constructor Summary

      Constructors 
      Constructor Description
      SegmentAxis​(StarColumnPredicate predicate, java.lang.Comparable[] keys)
      Creates a SegmentAxis populated with an array of key values.
      SegmentAxis​(StarColumnPredicate predicate, java.util.SortedSet<java.lang.Comparable> keySet, boolean hasNull)
      Creates a SegmentAxis populated with a set of key values.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.lang.Comparable[] getKeys()  
      int getMatchCount​(StarColumnPredicate predicate)
      Returns how many of this SegmentAxis's keys match a given constraint.
      (package private) int getOffset​(java.lang.Comparable key)  
      (package private) StarColumnPredicate getPredicate()  
      Pair<java.util.SortedSet<java.lang.Comparable>,​java.lang.Boolean> getValuesAndIndicator()  
      boolean wouldContain​(java.lang.Object key)
      Returns whether this axis contains a given key, or would contain it if it existed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • predicate

        final StarColumnPredicate predicate
        Constraint on the keys in this Axis. Never null.
    • Constructor Detail

      • SegmentAxis

        SegmentAxis​(StarColumnPredicate predicate,
                    java.lang.Comparable[] keys)
        Creates a SegmentAxis populated with an array of key values. The key values must be sorted.
        Parameters:
        predicate - Predicate defining which keys should appear on axis. (If a key passes the predicate but is not in the list, every cell with that key is assumed to have a null value.)
        keys - Keys
      • SegmentAxis

        public SegmentAxis​(StarColumnPredicate predicate,
                           java.util.SortedSet<java.lang.Comparable> keySet,
                           boolean hasNull)
        Creates a SegmentAxis populated with a set of key values.
        Parameters:
        predicate - Predicate defining which keys should appear on axis. (If a key passes the predicate but is not in the list, every cell with that key is assumed to have a null value.)
        keySet - Set of distinct key values, sorted
        hasNull - Whether the axis contains the null value, in addition to the values in valueSet
    • Method Detail

      • getKeys

        final java.lang.Comparable[] getKeys()
      • getOffset

        final int getOffset​(java.lang.Comparable key)
      • wouldContain

        public final boolean wouldContain​(java.lang.Object key)
        Returns whether this axis contains a given key, or would contain it if it existed.

        For example, if this axis is unconstrained, then this method returns true for any value.

        Parameters:
        key - Key
        Returns:
        Whether this axis would contain key
      • getMatchCount

        public int getMatchCount​(StarColumnPredicate predicate)
        Returns how many of this SegmentAxis's keys match a given constraint.
        Parameters:
        predicate - Predicate
        Returns:
        How many keys match constraint
      • getValuesAndIndicator

        public Pair<java.util.SortedSet<java.lang.Comparable>,​java.lang.Boolean> getValuesAndIndicator()