Class ConstantDouble

    • Field Detail

      • bytes

        private double bytes
    • Constructor Detail

      • ConstantDouble

        public ConstantDouble​(ConstantDouble c)
        Initialize from another object.
        Parameters:
        c - Source to copy.
      • ConstantDouble

        ConstantDouble​(java.io.DataInput file)
                throws java.io.IOException
        Initialize instance from file data.
        Parameters:
        file - Input stream.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • ConstantDouble

        public ConstantDouble​(double bytes)
        Constructs a ConstantDouble.
        Parameters:
        bytes - Data.
    • Method Detail

      • accept

        public void accept​(Visitor v)
        Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
        Specified by:
        accept in interface Node
        Specified by:
        accept in class Constant
        Parameters:
        v - Visitor object.
      • dump

        public void dump​(java.io.DataOutputStream file)
                  throws java.io.IOException
        Dumps constant double to file stream in binary format.
        Specified by:
        dump in class Constant
        Parameters:
        file - Output file stream.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • getBytes

        public double getBytes()
        Gets the data.
        Returns:
        data, that is, 8 bytes.
      • getConstantValue

        public java.lang.Object getConstantValue​(ConstantPool cp)
        Gets the Double object.
        Specified by:
        getConstantValue in interface ConstantObject
        Parameters:
        cp - the constant pool (not used).
        Returns:
        Double object.
      • setBytes

        public void setBytes​(double bytes)
        Sets the raw bytes that represent the double value.
        Parameters:
        bytes - the raw bytes that represent the double value.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Constant
        Returns:
        String representation.