Class JDFRangeList

java.lang.Object
org.cip4.jdflib.datatypes.JDFRangeList
All Implemented Interfaces:
JDFBaseDataTypes
Direct Known Subclasses:
JDFDateTimeRangeList, JDFDurationRangeList, JDFIntegerRangeList, JDFNameRangeList, JDFNumberRangeList, JDFRectangleRangeList, JDFShapeRangeList, JDFXYPairRangeList

public abstract class JDFRangeList extends Object implements JDFBaseDataTypes
This abstract class is the representation of a range list. Intern these object are collected in a vector and there are several methods to provide an access to the data. A range has the following format : "1~3.4" The class member Vector rangeList contains for example "1~3.4" , "7~5"
  • Field Details

  • Constructor Details

    • JDFRangeList

      public JDFRangeList()
      constructor
  • Method Details

    • elementAt

      public final Object elementAt(int i)
      getElementAt - returns the element at the ith position
      Parameters:
      i - the position of the element to be retrieved
      Returns:
      Object - the range object at the given position
    • remove

      public final void remove(int i)
      remove - removes an object from the vector
      Parameters:
      i - the index of the element to remove
    • isPartOfRange

      public final boolean isPartOfRange(JDFRange x)
      isPartOfRange - check whether range 'x' is in the range defined by 'this'
      Parameters:
      x - JDFRange to test
      Returns:
      boolean - true if 'x' is in the range defined by 'this'
    • isPartOfRange

      public final boolean isPartOfRange(JDFRangeList x)
      isPartOfRange - check whether JDFRangeList 'x' is within this range list
      Parameters:
      x - the range list to test
      Returns:
      boolean - true if range list 'x' is within 'this' range list, else false
    • getString

      @Deprecated public final String getString()
      Deprecated.
      060418 use toString
      getString - serialize to string
      Returns:
      String - a list of ranges in the format PT30M30S~PT35M (duration (JDFDate) has a format=P1Y2M3DT12H30M30S)
    • toString

      public final String toString()
      toString - serialize to string
      Overrides:
      toString in class Object
      Returns:
      String - a list of ranges in the format a ~ b
    • getString

      public final String getString(int precision)
      toString - serialize to string
      Returns:
      String - a list of ranges in the format a ~ b
    • size

      public final int size()
      number of Duration range elements
      Returns:
      int - the number of Duration ranges in the list
    • clear

      public final void clear()
      cleanup and empty the internal storge
    • at

      public final JDFRange at(int i)
      at(i) - get the i-th range element
      Parameters:
      i - index of the range to retrieve
      Returns:
      JDFRange - JDFDateTimeRange at the position i
    • begin

      public final JDFRange begin()
      begin() - returns the first JDFDateTimeRange of the JDFDateTimeRangeList
      Returns:
      JDFRange: the first JDFDateTimeRange of the JDFDateTimeRangeList
    • end

      public final JDFRange end()
      begin() - returns the last JDFDateTimeRange of the JDFDateTimeRangeList
      Returns:
      JDFRange: the last JDFDateTimeRange of the JDFDateTimeRangeList
    • erase

      public final void erase(int i)
      erase(i) - Removes the i-th element of the range list
      Parameters:
      i - index of element (range) to remove
    • isList

      public final boolean isList()
      isList - tests if 'this' is a List
      Returns:
      boolean - true if 'this' contains no ranges
    • equals

      public final boolean equals(Object other)
      equals - returns true if both JDFNumberRangeList are equal otherwise false
      Overrides:
      equals in class Object
      Returns:
      boolean - true if equal otherwise false
    • hashCode

      public final int hashCode()
      hashCode complements equals() to fulfill the equals/hashCode contract
      Overrides:
      hashCode in class Object
    • isUniqueOrdered

      public abstract boolean isUniqueOrdered()
      isUniqueOrdered - tests if this has only unique values and if the values are ordered
      Returns:
      true if values are unique and ordered, otherwise false
    • isUnique

      public final boolean isUnique()
      isUnique - tests if 'this' has only unique values
      Returns:
      boolean: true if 'this' is a unique range list
    • isOrdered

      public abstract boolean isOrdered()