Interface Type

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

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

    Modifier and Type
    Method
    Description
    int
    Compares this type with the specified Type to determine the natural order.
    boolean
    Determines if the given Type is equal to this one.
    int
    Returns a hash code value for this Type based on the authority, namespace, and identifier.

    Methods inherited from interface OsidPrimitive

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

    • compareTo

      int compareTo(Type type)
      Compares this type with the specified Type to determine the natural order. Returns a negative integer, zero, or a positive integer as this type is less than, equal to, or greater than the specified type. The natural ordering is determined first by the natural ordering of the authority, namespace, and identifier. If compareTo an type 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<Type>
      Parameters:
      type - the type to be compared
      Returns:
      a negative integer, zero, or a positive integer as this type is less than, equal to, or greater than the specified type
      Throws:
      ClassCastException - if the specified type's type prevents it from being compared to this type
    • equals

      boolean equals(Object obj)
      Determines if the given Type is equal to this one. Two Types are equal if their authority, namespace, and identifiers 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 Type, false otherwise
    • hashCode

      int hashCode()
      Returns a hash code value for this Type based on the authority, namespace, and identifier.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object