Class XYItemKey<S extends java.lang.Comparable<S>>

  • Type Parameters:
    S - the series key type.
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<XYItemKey<S>>, ItemKey

    public class XYItemKey<S extends java.lang.Comparable<S>>
    extends java.lang.Object
    implements ItemKey, java.lang.Comparable<XYItemKey<S>>, java.io.Serializable
    An object that references one data item in an XYZDataset. This is used internally to track the data item that a 3D object is related to, if any (and later that link is used for chart interaction). Instances of this class are immutable.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int itemIndex
      The index of an item within a series.
      private S seriesKey
      A key identifying a series in the dataset.
    • Constructor Summary

      Constructors 
      Constructor Description
      XYItemKey​(S seriesKey, int itemIndex)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(XYItemKey<S> key)  
      boolean equals​(java.lang.Object obj)
      Tests this instance for equality with an arbitrary object.
      int getItemIndex()
      Returns the item index.
      S getSeriesKey()
      Returns the series key.
      int hashCode()  
      java.lang.String toJSONString()
      Returns a JSON formatted string representing the key.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • seriesKey

        private final S extends java.lang.Comparable<S> seriesKey
        A key identifying a series in the dataset.
      • itemIndex

        private final int itemIndex
        The index of an item within a series.
    • Constructor Detail

      • XYItemKey

        public XYItemKey​(S seriesKey,
                         int itemIndex)
        Creates a new instance.
        Parameters:
        seriesKey - the series key.
        itemIndex - the item index.
    • Method Detail

      • getSeriesKey

        public S getSeriesKey()
        Returns the series key.
        Returns:
        The series key (never null).
      • getItemIndex

        public int getItemIndex()
        Returns the item index.
        Returns:
        The item index.
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests this instance for equality with an arbitrary object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to test (null permitted).
        Returns:
        A boolean.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toJSONString

        public java.lang.String toJSONString()
        Description copied from interface: ItemKey
        Returns a JSON formatted string representing the key.
        Specified by:
        toJSONString in interface ItemKey
        Returns:
        A JSON formatted string.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(XYItemKey<S> key)
        Specified by:
        compareTo in interface java.lang.Comparable<S extends java.lang.Comparable<S>>