Enum Length.Units

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

    public static enum Length.Units
    extends java.lang.Enum<Length.Units>
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CENTIMETRE
      The centimetre, symbol cm, equal to 0.01m.
      INCH
      The inch, symbol in, equal to 25.4mm or 72pt.
      KILOMETRE
      The kilometre, symbol km, equal to 1000m.
      METRE
      The metre, symbol m, is the SI unit of length.
      MILLIMETRE
      The millimetre, symbol mm, equal to 0.001m.
      POINT
      The point, symbol pt, is the default unit used in PDF documents, equal to 1/72in or 25.4/72mm.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Length.Units get​(java.lang.String symbol)
      Get the unit enum value from its symbol, e.g.
      java.lang.String getSymbol()
      Get the unit's symbol name.
      java.lang.String toString()  
      static Length.Units valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Length.Units[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

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

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

      • METRE

        public static final Length.Units METRE
        The metre, symbol m, is the SI unit of length.
      • POINT

        public static final Length.Units POINT
        The point, symbol pt, is the default unit used in PDF documents, equal to 1/72in or 25.4/72mm. This is the unit used internally by the Length object.
      • KILOMETRE

        public static final Length.Units KILOMETRE
        The kilometre, symbol km, equal to 1000m.
      • CENTIMETRE

        public static final Length.Units CENTIMETRE
        The centimetre, symbol cm, equal to 0.01m.
      • MILLIMETRE

        public static final Length.Units MILLIMETRE
        The millimetre, symbol mm, equal to 0.001m.
      • INCH

        public static final Length.Units INCH
        The inch, symbol in, equal to 25.4mm or 72pt.
    • Method Detail

      • values

        public static Length.Units[] 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 (Length.Units c : Length.Units.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Length.Units 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
      • getSymbol

        public java.lang.String getSymbol()
        Get the unit's symbol name.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<Length.Units>
      • get

        public static Length.Units get​(java.lang.String symbol)
        Get the unit enum value from its symbol, e.g. m, or in.
        Parameters:
        symbol - the symbol, e.g. m, or in.
        Returns: