Class JDFNameRange

  • All Implemented Interfaces:
    JDFBaseDataTypes

    public class JDFNameRange
    extends JDFRange
    This class represents a name range (JDFNameRange). It is a whitespace separated list of 2 names separated by a tilde "~", for example "jack ~ john"
    • Constructor Detail

      • JDFNameRange

        public JDFNameRange()
        constructor
      • JDFNameRange

        public JDFNameRange​(java.lang.String s)
        constructs a JDFNameRange with the given string
        Parameters:
        s - the given string
        Throws:
        java.util.zip.DataFormatException - - if the String has not a valid format
      • JDFNameRange

        public JDFNameRange​(java.lang.String p_left,
                            java.lang.String p_right)
        constructs a JDFNameRange with two given strings the left and the right name
        Parameters:
        p_left - the given left string
        p_right - the given right string
      • JDFNameRange

        public JDFNameRange​(JDFNameRange nr)
        constructs a JDFNameRange with a give JDFNameRange
        Parameters:
        JDFNameRange - nr
    • Method Detail

      • toString

        public java.lang.String toString()
        toString
        Overrides:
        toString in class JDFRange
        Returns:
        String
      • inRange

        public boolean inRange​(java.lang.String x)
        inRange - returns true if (left string >= x <= right string), it is a lexicographical compare
        Parameters:
        x - comparison string
        Returns:
        boolean - true if x in range otherwise false
      • equals

        public boolean equals​(java.lang.Object other)
        equals - returns true if both JDFNameRange are equal otherwise false
        Overrides:
        equals in class JDFRange
        Parameters:
        other - Object to compare
        Returns:
        boolean - true if equal, otherwise false
      • hashCode

        public int hashCode()
        hashCode complements equals() to fulfill the equals/hashCode contract
        Overrides:
        hashCode in class JDFRange
        Returns:
        int
      • getLowerValue

        public java.lang.String getLowerValue()
        getLowerValue - returns the lower value of the range
        Returns:
        String - the lower value of the range
      • getUpperValue

        public java.lang.String getUpperValue()
        getUpperValue - return the upper value of the range
        Returns:
        String - the upper value of the range
      • isValid

        protected void isValid​(java.lang.String s)
        isValid - validates the given String
        Parameters:
        s - the given string
        Throws:
        java.util.zip.DataFormatException - - if the String has not a valid format
      • getLeft

        public java.lang.String getLeft()
      • getRight

        public java.lang.String getRight()
      • isPartOfRange

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

        protected java.lang.Object getRightObject()
        Specified by:
        getRightObject in class JDFRange
      • getLeftObject

        protected java.lang.Object getLeftObject()
        Specified by:
        getLeftObject in class JDFRange
      • inObjectRange

        protected boolean inObjectRange​(java.lang.Object other)
        Overrides:
        inObjectRange in class JDFRange