FileDocCategorySizeDatePackage
ConstantFloat.javaAPI DocJava SE 5 API4912Fri Aug 26 14:55:16 BST 2005com.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.1.1 2001/10/29 19:59:58 jvanzyl 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
throw
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
throw
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 + ")";