Enum NumericEncoding

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<NumericEncoding>

    public enum NumericEncoding
    extends java.lang.Enum<NumericEncoding>
    Enumeration of numeric encoding values supported by CDF.
    Since:
    20 Jun 2013
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static NumericEncoding getEncoding​(int code)
      Returns the encoding corresponding to the value of the encoding field of the CDF Descriptor Record.
      java.lang.Boolean isBigendian()
      Gives the big/little-endianness of this encoding, if that's all the work that has to be done.
      static NumericEncoding valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static NumericEncoding[] 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
    • Method Detail

      • values

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

        public static NumericEncoding 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
      • isBigendian

        public java.lang.Boolean isBigendian()
        Gives the big/little-endianness of this encoding, if that's all the work that has to be done. If the return value is non-null, then numeric values are encoded the same way that java does it (two's complement for integers and IEEE754 for floating point) with big- or little-endian byte ordering, according to the return value. Otherwise, some unspecified encoding is in operation.
        Returns:
        TRUE for simple big-endian, FALSE for simple little-endian, null for something weird
      • getEncoding

        public static NumericEncoding getEncoding​(int code)
                                           throws CdfFormatException
        Returns the encoding corresponding to the value of the encoding field of the CDF Descriptor Record.
        Parameters:
        code - encoding code
        Returns:
        encoding object
        Throws:
        CdfFormatException - if code is unknown