FileDocCategorySizeDatePackage
ConstantFloat.javaAPI DocJava SE 6 API4917Tue Jun 10 00:22:16 BST 2008com.sun.org.apache.bcel.internal.classfile

ConstantFloat

public final class ConstantFloat extends Constant implements ConstantObject
This class is derived from the abstract Constant class and represents a reference to a float object.
version
$Id: ConstantFloat.java,v 1.1.2.1 2005/07/31 23:46:29 jeffsuttor Exp $
author
M. Dahm
see
Constant

Fields Summary
private float
bytes
Constructors Summary
public ConstantFloat(float bytes)

param
bytes Data

    
    super(Constants.CONSTANT_Float);
    this.bytes = bytes;
  
public ConstantFloat(ConstantFloat c)
Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

    this(c.getBytes());
  
ConstantFloat(DataInputStream file)
Initialize instance from file data.

param
file Input stream
throws
IOException

    
    this(file.readFloat());
  
Methods Summary
public voidaccept(com.sun.org.apache.bcel.internal.classfile.Visitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

param
v Visitor object

    v.visitConstantFloat(this);
  
public final voiddump(java.io.DataOutputStream file)
Dump constant float to file stream in binary format.

param
file Output file stream
throws
IOException

    file.writeByte(tag);
    file.writeFloat(bytes);
  
public final floatgetBytes()

return
data, i.e., 4 bytes.

 return bytes; 
public java.lang.ObjectgetConstantValue(com.sun.org.apache.bcel.internal.classfile.ConstantPool cp)

return
Float object

    return new Float(bytes);
  
public final voidsetBytes(float bytes)

param
bytes.

    this.bytes = bytes;
  
public final java.lang.StringtoString()

return
String representation.

    return super.toString() + "(bytes = " + bytes + ")";