Enum UnitStatus.Code

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<UnitStatus.Code>
    Enclosing class:
    UnitStatus

    public static enum UnitStatus.Code
    extends java.lang.Enum<UnitStatus.Code>
    Characterises VOUnits standard conformance.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BAD_SYNTAX
      Cannot be parsed as VOUnit.
      DEPRECATED
      Contains some units deprecated in VOUnits standard.
      GUESSED_UNIT
      Parsed as VOUnit but contains unknown though guessable units.
      OK
      Conforms to VOUnits standard.
      PARSE_ERROR
      Cannot be parsed as VOUnit (shouldn't happen).
      UNKNOWN_UNIT
      Parsed as VOUnit but contains unknown base units.
      USAGE
      Violates VOUnit usage constraints.
      WHITESPACE
      Legal VOUnit except that it contains illegal whitespace.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isError()
      Indicates whether this code represents an invalid VOUnit specification.
      boolean isWarning()
      Indicates whether this status represents a UCD value which may deserve attention, but is not actually a standards violation.
      static UnitStatus.Code valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static UnitStatus.Code[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • DEPRECATED

        public static final UnitStatus.Code DEPRECATED
        Contains some units deprecated in VOUnits standard.
      • UNKNOWN_UNIT

        public static final UnitStatus.Code UNKNOWN_UNIT
        Parsed as VOUnit but contains unknown base units.
      • GUESSED_UNIT

        public static final UnitStatus.Code GUESSED_UNIT
        Parsed as VOUnit but contains unknown though guessable units.
      • BAD_SYNTAX

        public static final UnitStatus.Code BAD_SYNTAX
        Cannot be parsed as VOUnit.
      • PARSE_ERROR

        public static final UnitStatus.Code PARSE_ERROR
        Cannot be parsed as VOUnit (shouldn't happen).
      • USAGE

        public static final UnitStatus.Code USAGE
        Violates VOUnit usage constraints.
      • WHITESPACE

        public static final UnitStatus.Code WHITESPACE
        Legal VOUnit except that it contains illegal whitespace.
    • Method Detail

      • values

        public static UnitStatus.Code[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (UnitStatus.Code c : UnitStatus.Code.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static UnitStatus.Code valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isError

        public boolean isError()
        Indicates whether this code represents an invalid VOUnit specification.
        Returns:
        true for error status
      • isWarning

        public boolean isWarning()
        Indicates whether this status represents a UCD value which may deserve attention, but is not actually a standards violation. Note this includes use of unknown and non-standard, as well as deprecated, units that are still syntactically permissible.
        Returns:
        true for warning status