Interface Heading

All Superinterfaces:
Comparable<Heading>, OsidPrimitive, Serializable
All Known Subinterfaces:
Heading

public interface Heading extends OsidPrimitive, Comparable<Heading>
Supplements the OSID Heading interface for Java.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compareTo(Heading heading)
    Compares this heading with the specified Heading to determine the natural order.
    boolean
    Determines if the given Heading is equal to this one.
    Gets the outer bounds of the heading.
    int
    Returns a hash code value for this Heading.
    boolean
    Tests if this Heading, as specified by its uncertainty, does not overlap the given Heading.
    boolean
    Tests if this Heading, as specified by its uncertainty, completely includes the given Heading ranged by its uncertainty.

    Methods inherited from interface OsidPrimitive

    toString
    Modifier and Type
    Method
    Description
    Returns a string representation of this OsidPrimitive.
  • Method Details

    • isInclusive

      boolean isInclusive(Heading heading)
      Tests if this Heading, as specified by its uncertainty, completely includes the given Heading ranged by its uncertainty. If either heading has an uncertainty of infinity this method returns false. It is possible for isInclusive() and isExclsuive() to be both false among two Headings due to uncertainties in the values.
      Parameters:
      heading - the heading to compare
      Returns:
      true if this heading includes the given heading, false otherwise
      Throws:
      NullArgumentException - heading is null
      UnsupportedException - cannot compare heading
    • isExclusive

      boolean isExclusive(Heading heading)
      Tests if this Heading, as specified by its uncertainty, does not overlap the given Heading. If either heading has an uncertainty of infinity this method returns false. It is possible for isInclusive() and isExclsuive() to be both false among two Headings due to uncertainties in the values.
      Parameters:
      heading - the heading to compare
      Returns:
      true if this heading is excluded, false otherwise
      Throws:
      NullArgumentException - heading is null
      UnsupportedException - 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

      int compareTo(Heading heading)
      Compares this heading with the specified Heading to 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. If compareTo a heading is zero, then equals() must be true and their hash codes must also be equal for consistent behavior. For orderings that may yield inconsistent behavior, an external Comparator should be used.
      Specified by:
      compareTo in interface Comparable<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

      boolean equals(Object obj)
      Determines if the given Heading is equal to this one. Two Headings are equal if their heading type and values are equal. If equals() is true, then compareTo() must be zero and their hash codes must also be equal for consistent behavior. For orderings that may yield inconsistent behavior, an external Comparator should be used. If obj is null or if a different interface, this method returns false.
      Overrides:
      equals in class Object
      Parameters:
      obj - an object to compare
      Returns:
      true if the given object is equal to this Heading, false otherwise
    • hashCode

      int hashCode()
      Returns a hash code value for this Heading. The hash code is determined by the heading type and values.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object