fr.umlv.corosol.classfile.constant.impl
Class DefaultJConstantFloat

java.lang.Object
  extended by fr.umlv.corosol.classfile.constant.impl.AbstractJConstant
      extended by fr.umlv.corosol.classfile.constant.impl.DefaultJConstantFloat
All Implemented Interfaces:
JConstant, JConstantFloat, JLoadableConstant, JClassFileItem, JObject

public class DefaultJConstantFloat
extends AbstractJConstant
implements JConstantFloat

The default implementation of JConstantFloat interface.

Author:
Christophe Deleray

Field Summary
 
Fields inherited from interface fr.umlv.corosol.classfile.constant.JConstant
CONSTANT_CLASS, CONSTANT_DOUBLE, CONSTANT_FIELDREF, CONSTANT_FLOAT, CONSTANT_INTEGER, CONSTANT_INTERFACE_METHODREF, CONSTANT_LONG, CONSTANT_METHODREF, CONSTANT_NAME_AND_TYPE, CONSTANT_STRING, CONSTANT_UTF8
 
Constructor Summary
DefaultJConstantFloat()
          Default constructor.
DefaultJConstantFloat(float floatValue)
          Creates a new CONSTANT_Float_info entry with the specified float value.
 
Method Summary
 float getFloatValue()
          Returns the value stored in this constant pool entry.
 void pushConstantValue(JStackFrame frame)
          Pushes the value onto the top of the operand stack of the specified stack frame.
 void readItem(JClassFileInput in)
          Extracts the data of this constant pool entry from the specified input stream.
 void setFloatValue(float floatValue)
          Sets the float value stored in this constant pool entry with the specified value.
 java.lang.String toString()
          Returns a string representation of this constant pool entry.
 void writeItem(JClassFileOutput out)
          Writes the data of this constant pool entry to a classfile via the specified output stream.
 
Methods inherited from class fr.umlv.corosol.classfile.constant.impl.AbstractJConstant
getConstantPool, getLength, getTag, setConstantPool
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fr.umlv.corosol.classfile.constant.JConstant
getLength, getTag
 
Methods inherited from interface fr.umlv.corosol.classfile.JClassFileItem
getConstantPool, setConstantPool
 

Constructor Detail

DefaultJConstantFloat

public DefaultJConstantFloat()
Default constructor.


DefaultJConstantFloat

public DefaultJConstantFloat(float floatValue)
Creates a new CONSTANT_Float_info entry with the specified float value.

Parameters:
floatValue - a float value to be stored in this entry
Method Detail

readItem

public void readItem(JClassFileInput in)
              throws java.io.IOException
Extracts the data of this constant pool entry from the specified input stream.

Specified by:
readItem in interface JClassFileItem
Parameters:
in - a class file input stream
Throws:
java.io.IOException - if an I/O error occurs when reading the datas of this constant pool entry

writeItem

public void writeItem(JClassFileOutput out)
               throws java.io.IOException
Writes the data of this constant pool entry to a classfile via the specified output stream.

Specified by:
writeItem in interface JClassFileItem
Parameters:
out - a class file output stream
Throws:
java.io.IOException - if an I/O error occurs when writing into the classfile

pushConstantValue

public void pushConstantValue(JStackFrame frame)
Pushes the value onto the top of the operand stack of the specified stack frame.

Specified by:
pushConstantValue in interface JLoadableConstant
Parameters:
frame - a stack frame

getFloatValue

public float getFloatValue()
Returns the value stored in this constant pool entry.

Specified by:
getFloatValue in interface JConstantFloat
Returns:
the float value stored in this constant pool entry

setFloatValue

public void setFloatValue(float floatValue)
Sets the float value stored in this constant pool entry with the specified value.

Specified by:
setFloatValue in interface JConstantFloat
Parameters:
floatValue - an float value to be stored in this entry

toString

public java.lang.String toString()
Returns a string representation of this constant pool entry.

Specified by:
toString in interface JConstant
Specified by:
toString in class AbstractJConstant
Returns:
a string representing this constant pool entry