Package org.apache.bcel.classfile
Class ConstantLong
java.lang.Object
org.apache.bcel.classfile.Constant
org.apache.bcel.classfile.ConstantLong
- All Implemented Interfaces:
Cloneable,ConstantObject,Node
This class is derived from the abstract
Constant and represents a reference to a long object.- See Also:
-
Field Summary
FieldsFields inherited from class org.apache.bcel.classfile.Constant
EMPTY_ARRAY, tag -
Constructor Summary
ConstructorsConstructorDescriptionConstantLong(long bytes) Constructs a ConstantLong.ConstantLong(DataInput file) Initialize instance from file data.Initialize from another object. -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.voiddump(DataOutputStream file) Dumps constant long to file stream in binary format.longgetBytes()Gets the data.Gets the Long object.voidsetBytes(long bytes) Sets the raw bytes that represent the long value.toString()Methods inherited from class org.apache.bcel.classfile.Constant
clone, copy, equals, getComparator, getTag, hashCode, readConstant, setComparator
-
Field Details
-
bytes
private long bytes
-
-
Constructor Details
-
ConstantLong
Initialize from another object.- Parameters:
c- Source to copy.
-
ConstantLong
ConstantLong(DataInput file) throws IOException Initialize instance from file data.- Parameters:
file- Input stream.- Throws:
IOException- Thrown if an I/O error occurs.
-
ConstantLong
public ConstantLong(long bytes) Constructs a ConstantLong.- Parameters:
bytes- Data.
-
-
Method Details
-
accept
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. -
dump
Dumps constant long to file stream in binary format.- Specified by:
dumpin classConstant- Parameters:
file- Output file stream.- Throws:
IOException- Thrown if an I/O error occurs.
-
getBytes
public long getBytes()Gets the data.- Returns:
- data, that is, 8 bytes.
-
getConstantValue
Gets the Long object.- Specified by:
getConstantValuein interfaceConstantObject- Parameters:
cp- The constant pool (not used).- Returns:
- Long object.
-
setBytes
public void setBytes(long bytes) Sets the raw bytes that represent the long value.- Parameters:
bytes- The raw bytes that represent the long value.
-
toString
-