Class ReadField

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean defaulted  
      private java.lang.String name  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ReadField​(java.lang.String name, boolean defaulted)
      Construct a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(ReadField o)
      Compare this field with another on the basis of its name.
      boolean getBoolean()
      Get the boolean value of this field.
      byte getByte()
      Get the byte value of this field.
      char getChar()
      Get the character value of this field.
      double getDouble()
      Get the double value of this field.
      float getFloat()
      Get the float value of this field.
      int getInt()
      Get the integer value of this field.
      abstract Kind getKind()
      Get the kind of field represented by this object.
      long getLong()
      Get the long value of this field.
      java.lang.String getName()
      Get the field name.
      java.lang.Object getObject()
      Get the object value of this field.
      short getShort()
      Get the short value of this field.
      boolean isDefaulted()
      Determine whether this field was defaulted.
      private static java.lang.IllegalArgumentException wrongFieldType()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        private final java.lang.String name
      • defaulted

        private final boolean defaulted
    • Constructor Detail

      • ReadField

        protected ReadField​(java.lang.String name,
                            boolean defaulted)
        Construct a new instance.
        Parameters:
        name - the field name
        defaulted - true if the field's value was defaulted, false otherwise
    • Method Detail

      • getKind

        public abstract Kind getKind()
        Get the kind of field represented by this object.
        Returns:
        the kind of field represented by this object
      • getName

        public java.lang.String getName()
        Get the field name.
        Returns:
        the field name
      • isDefaulted

        public boolean isDefaulted()
        Determine whether this field was defaulted.
        Returns:
        true if this field value was defaulted, false otherwise
      • getBoolean

        public boolean getBoolean()
                           throws java.io.IOException
        Get the boolean value of this field.
        Returns:
        the boolean value of this field
        Throws:
        java.io.IOException - if the value cannot be read
      • getChar

        public char getChar()
                     throws java.io.IOException
        Get the character value of this field.
        Returns:
        the character value of this field
        Throws:
        java.io.IOException - if the value cannot be read
      • getFloat

        public float getFloat()
                       throws java.io.IOException
        Get the float value of this field.
        Returns:
        the float value of this field
        Throws:
        java.io.IOException - if the value cannot be read
      • getDouble

        public double getDouble()
                         throws java.io.IOException
        Get the double value of this field.
        Returns:
        the double value of this field
        Throws:
        java.io.IOException - if the value cannot be read
      • getByte

        public byte getByte()
                     throws java.io.IOException
        Get the byte value of this field.
        Returns:
        the byte value of this field
        Throws:
        java.io.IOException - if the value cannot be read
      • getShort

        public short getShort()
                       throws java.io.IOException
        Get the short value of this field.
        Returns:
        the short value of this field
        Throws:
        java.io.IOException - if the value cannot be read
      • getInt

        public int getInt()
                   throws java.io.IOException
        Get the integer value of this field.
        Returns:
        the integer value of this field
        Throws:
        java.io.IOException - if the value cannot be read
      • getLong

        public long getLong()
                     throws java.io.IOException
        Get the long value of this field.
        Returns:
        the long value of this field
        Throws:
        java.io.IOException - if the value cannot be read
      • getObject

        public java.lang.Object getObject()
                                   throws java.io.IOException
        Get the object value of this field.
        Returns:
        the object value of this field
        Throws:
        java.io.IOException - if the value cannot be read
      • wrongFieldType

        private static java.lang.IllegalArgumentException wrongFieldType()
      • compareTo

        public int compareTo​(ReadField o)
        Compare this field with another on the basis of its name.
        Specified by:
        compareTo in interface java.lang.Comparable<ReadField>
        Parameters:
        o - the other field object
        Returns:
        the sort result based on the name of this field and the given field