Class JDFDurationRange

java.lang.Object
org.cip4.jdflib.datatypes.JDFRange
org.cip4.jdflib.datatypes.JDFDurationRange
All Implemented Interfaces:
JDFBaseDataTypes

public class JDFDurationRange extends JDFRange
  • Constructor Details

    • JDFDurationRange

      public JDFDurationRange()
      Empty range constructor
    • JDFDurationRange

      public JDFDurationRange(JDFDuration x)
      Constructor - creates a Duration range defined by x
    • JDFDurationRange

      public JDFDurationRange(JDFDuration xmin, JDFDuration xmax)
      Constructor - creates a Duration range defined by xmin to xmax
    • JDFDurationRange

      public JDFDurationRange(JDFDurationRange r)
      copy constructor
    • JDFDurationRange

      public JDFDurationRange(String s) throws DataFormatException
      Construct a JDFDurationRange from a string
      Throws:
      DataFormatException - - if the String has not a valid format
  • Method Details

    • init

      protected void init(JDFDuration xmin, JDFDuration xmax)
      Initialization
    • isValid

      public boolean isValid(String s)
      isValid - validate the given String
      Parameters:
      s - the given string
      Returns:
      boolean - false if the String has not a valid format
    • inRange

      public boolean inRange(JDFDuration x)
      inRange - returns true if 'x' is within the range defined by 'this'
      Parameters:
      x - JDFDuration that is to be compared with 'this'
      Returns:
      boolean - true if 'x' is within the range defined by 'this'
    • isPartOfRange

      public boolean isPartOfRange(JDFRange ra)
      isPartOfRange - is range 'r' within this range?
      Specified by:
      isPartOfRange in class JDFRange
      Parameters:
      r - the range to test
      Returns:
      boolean - true if range 'r' is within this range, else false
    • getLeft

      public JDFDuration getLeft()
      getLeft - get the left of the two range deliminators xmin ~ xmax
      Returns:
      JDFDuration - the left value
    • getRight

      public JDFDuration getRight()
      getRight - get the right of the two range deliminators xmin ~ xmax
      Returns:
      JDFDuration - the right value
    • setLeft

      public void setLeft(JDFDuration x)
      setLeft - sets the left JDFDuration object of the range
      Parameters:
      x - the left JDFDuration object of the range
    • setRight

      public void setRight(JDFDuration x)
      setRight - sets the right JDFDuration object of the range
      Parameters:
      x - the right JDFDuration object of the range
    • getUpperValue

      public JDFDuration getUpperValue()
      getUpperValue - returns the upper value of the bounds
      Returns:
      JDFDuration - the upper value of the range
    • getLowerValue

      public JDFDuration getLowerValue()
      getLowerValue - returns the lower value of the bounds
      Returns:
      JDFDuration - the lower value of the range
    • getRightObject

      protected JDFDuration getRightObject()
      Specified by:
      getRightObject in class JDFRange
    • getLeftObject

      protected JDFDuration getLeftObject()
      Specified by:
      getLeftObject in class JDFRange
    • inObjectRange

      protected boolean inObjectRange(Object other)
      Overrides:
      inObjectRange in class JDFRange
    • getRightString

      public String getRightString(int precision)
      Overrides:
      getRightString in class JDFRange
    • getLeftString

      public String getLeftString(int precision)
      Overrides:
      getLeftString in class JDFRange
    • createDurationRange

      public static JDFDurationRange createDurationRange(String duration)