FileDocCategorySizeDatePackage
ConstantLong.javaAPI DocJava SE 5 API4794Fri Aug 26 14:55:16 BST 2005com.sun.org.apache.bcel.internal.classfile

ConstantLong

public final class ConstantLong extends Constant implements ConstantObject
This class is derived from the abstract Constant class and represents a reference to a long object.
version
$Id: ConstantLong.java,v 1.1.1.1 2001/10/29 19:59:59 jvanzyl Exp $
author
M. Dahm
see
Constant

Fields Summary
private long
bytes
Constructors Summary
public ConstantLong(long bytes)

param
bytes Data

    super(Constants.CONSTANT_Long);
    this.bytes = bytes;
  
public ConstantLong(ConstantLong c)
Initialize from another object.

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

param
file Input stream
throw
IOException

    
    this(file.readLong());
  
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.visitConstantLong(this);
  
public final voiddump(java.io.DataOutputStream file)
Dump constant long to file stream in binary format.

param
file Output file stream
throw
IOException

    file.writeByte(tag);
    file.writeLong(bytes);
  
public final longgetBytes()

return
data, i.e., 8 bytes.

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

return
Long object

    return new Long(bytes);
  
public final voidsetBytes(long bytes)

param
bytes.

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

return
String representation.

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