Package table

Class OrdinalType

java.lang.Object
table.ColType
table.OrdinalType
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
DateType, MetricType

public abstract class OrdinalType extends ColType implements Cloneable
Class for ordinal types for data tables.
Since:
2006.09.16
See Also:
  • Field Details

    • mininfo

      protected transient Object mininfo
      the information stored with the minimum value
    • maxinfo

      protected transient Object maxinfo
      the information stored with the maximum value
  • Constructor Details

    • OrdinalType

      public OrdinalType()
      Create an ordinal type.
      Since:
      2023.07.26 (Christian Borgelt)
  • Method Details

    • getValue

      public Object getValue(int id)
      Get the value associated with an identifier.
      Overrides:
      getValue in class ColType
      Parameters:
      id - the value identifier
      Returns:
      "minimum" if id ≤ 0 and "maximum" otherwise
      Since:
      2007.07.18 (Christian Borgelt)
    • getMin

      public abstract Object getMin()
      Get the minimal value.
      Returns:
      the minimal value
      Since:
      2006.09.11 (Christian Borgelt)
    • getMax

      public abstract Object getMax()
      Get the maximal value.
      Returns:
      the maximal value
      Since:
      2006.09.11 (Christian Borgelt)
    • getMinInfo

      public Object getMinInfo()
      Get the information associated with the minimal value.
      Returns:
      the information associated with the minimal value
      Since:
      2007.02.18 (Christian Borgelt)
    • setMinInfo

      public void setMinInfo(Object info)
      Set the information for the minimal value.
      Parameters:
      info - the information to store with the minimal value
      Since:
      2007.02.18 (Christian Borgelt)
    • getMaxInfo

      public Object getMaxInfo()
      Get the information associated with the maximal value.
      Returns:
      the information associated with the maximal value
      Since:
      2007.02.18 (Christian Borgelt)
    • setMaxInfo

      public void setMaxInfo(Object info)
      Set the information for the maximal value.
      Parameters:
      info - the information to store with the maximal value
      Since:
      2007.02.18 (Christian Borgelt)
    • getInfoCount

      public int getInfoCount()
      Get the number of pieces of additional information.

      Additional information can be stored with the minimum and the maximum value.

      Overrides:
      getInfoCount in class ColType
      Returns:
      always 2
      Since:
      2007.07.13 (Christian Borgelt)
    • getInfo

      public Object getInfo(Object value)
      Get the information associated with a value.
      Overrides:
      getInfo in class ColType
      Parameters:
      value - the value for which to get the information
      Returns:
      always null
      Since:
      2007.02.18 (Christian Borgelt)
    • setInfo

      public void setInfo(Object value, Object info)
      Get the information associated with a value.

      If value.toString().equals("maximum") or value.toString().equals("max"), the additional information associated with the maximum value, otherwise the additional information associated with the minimum value is set.

      Overrides:
      setInfo in class ColType
      Parameters:
      value - the value for which to set the information
      info - the additional information to store
      Since:
      2007.02.18 (Christian Borgelt)
    • getInfo

      public Object getInfo(int id)
      Get the information associated with a value.

      If id ≤ 0, the additional information associated with the minimum value, otherwise the additional information associated with the maximum value is retrieved.

      Overrides:
      getInfo in class ColType
      Parameters:
      id - the identifier of the value
      Returns:
      the information associated with the value
      Since:
      2007.02.20 (Christian Borgelt)
    • setInfo

      public void setInfo(int id, Object info)
      Set the information associated with a value.

      If id ≤ 0, the additional information associated with the minimum value, otherwise the additional information associated with the maximum value is set.

      Overrides:
      setInfo in class ColType
      Parameters:
      id - the identifier of the value
      info - the information to set
      Since:
      2007.02.20 (Christian Borgelt)
    • compare

      public abstract int compare(Object a, Object b)
      Compare two values of this type.
      Parameters:
      a - the first value
      b - the second value
      Returns:
      -1 if the first value is smaller,
      +1 if the second value is smaller,
      0 if the value are equal
      Since:
      2007.02.02 (Christian Borgelt)