Interface Heading
- All Superinterfaces:
Comparable<Heading>, OsidPrimitive, Serializable
- All Known Subinterfaces:
Heading
Supplements the OSID Heading interface for Java.
-
Method Summary
Modifier and TypeMethodDescriptionintCompares this heading with the specifiedHeadingto determine the natural order.booleanDetermines if the givenHeadingis equal to this one.Heading[]Gets the outer bounds of the heading.inthashCode()Returns a hash code value for thisHeading.booleanisExclusive(Heading heading) Tests if thisHeading, as specified by its uncertainty, does not overlap the givenHeading.booleanisInclusive(Heading heading) Tests if thisHeading, as specified by its uncertainty, completely includes the givenHeadingranged by its uncertainty.Methods inherited from interface OsidPrimitive
toString
-
Method Details
-
isInclusive
Tests if thisHeading, as specified by its uncertainty, completely includes the givenHeadingranged by its uncertainty. If either heading has an uncertainty of infinity this method returns false. It is possible forisInclusive()andisExclsuive()to be bothfalseamong twoHeadingsdue to uncertainties in the values.- Parameters:
heading- the heading to compare- Returns:
trueif this heading includes the given heading,falseotherwise- Throws:
NullArgumentException-headingisnullUnsupportedException- cannot compare heading
-
isExclusive
Tests if thisHeading, as specified by its uncertainty, does not overlap the givenHeading. If either heading has an uncertainty of infinity this method returns false. It is possible forisInclusive()andisExclsuive()to be bothfalseamong twoHeadingsdue to uncertainties in the values.- Parameters:
heading- the heading to compare- Returns:
trueif this heading is excluded,falseotherwise- Throws:
NullArgumentException-headingisnullUnsupportedException- cannot compare heading
-
getOuterBound
Heading[] getOuterBound()Gets the outer bounds of the heading. The outer bounds are the heading minus and plus the uncertainty. This method returns the Headings forming the largest radius allowed by its uncertainty.- Returns:
- the heading outer bounds
-
compareTo
Compares this heading with the specifiedHeadingto determine the natural order. Returns a negative integer, zero, or a positive integer as this heading is less than, equal to, or greater than the specified heading. The natural ordering is determined first by the natural ordering of the heading type, then by its values. This method is not useful for numeric comparisons. The ranges implied by their granularities and uncertainties may overlap in such a way that two unequal Headings may be neither less than or greater than the other. IfcompareToa heading is zero, thenequals()must betrueand their hash codes must also be equal for consistent behavior. For orderings that may yield inconsistent behavior, an externalComparatorshould be used.- Specified by:
compareToin interfaceComparable<Heading>- Parameters:
heading- the heading to be compared- Returns:
- a negative integer, zero, or a positive integer as this heading is less than, equal to, or greater than the specified heading
- Throws:
ClassCastException- if the specified heading's type prevents it from being compared to this heading
-
equals
Determines if the givenHeadingis equal to this one. TwoHeadingsare equal if their heading type and values are equal. Ifequals()istrue, thencompareTo()must be zero and their hash codes must also be equal for consistent behavior. For orderings that may yield inconsistent behavior, an externalComparatorshould be used. Ifobjis null or if a different interface, this method returnsfalse. -
hashCode
-