Top Description Fields Constructors Methods
org.apache.bcel.classfile

public final Class ConstantInteger

extends Constant
implements ConstantObject
Class Inheritance
All Implemented Interfaces
org.apache.bcel.classfile.ConstantObject
Imports
java.io.DataInput, .DataOutputStream, .IOException, org.apache.bcel.Const

This class is derived from the abstract Constant and represents a reference to an int object.
See Also
Constant

Field Summary

Modifier and TypeField and Description
private int
Inherited from org.apache.bcel.classfile.Constant:
tag

Constructor Summary

AccessConstructor and Description
public
ConstantInteger(final ConstantInteger
Source to copy.
c
)

Initialize from another object.

pack-priv
ConstantInteger(final DataInput
Input stream
file
)

Initialize instance from file data.

public
ConstantInteger(final int
Data
bytes
)

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements abstract org.apache.bcel.classfile.Constant.accept.

Implements org.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
public void
dump(final DataOutputStream
Output file stream
file
)

Implements abstract org.apache.bcel.classfile.Constant.dump.

Dump constant integer to file stream in binary format.
public int

Returns:

data, i.e., 4 bytes.
getBytes
()

public Object

Returns:

Integer object
getConstantValue
(final ConstantPool
the constant.
cp
)

Implements org.apache.bcel.classfile.ConstantObject.getConstantValue.

Gets the object representing the constant, e.g., Long for ConstantLong.
public void
setBytes(final int
the raw bytes that represent this integer
bytes
)

public String

Returns:

String representation.
toString
()

Overrides org.apache.bcel.classfile.Constant.toString.

Returns a string representation of the object.
Inherited from org.apache.bcel.classfile.Constant:
clonecopyequalsgetComparatorgetTaghashCodereadConstantsetComparator

Field Detail

bytesback to summary
private int bytes

Constructor Detail

ConstantIntegerback to summary
public ConstantInteger(final ConstantInteger c)

Initialize from another object.

Parameters
c:ConstantInteger

Source to copy.

ConstantIntegerback to summary
pack-priv ConstantInteger(final DataInput file) throws IOException

Initialize instance from file data.

Parameters
file:DataInput

Input stream

Exceptions
IOException:
if an I/O error occurs.
ConstantIntegerback to summary
public ConstantInteger(final int bytes)
Parameters
bytes:int

Data

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements abstract org.apache.bcel.classfile.Constant.accept.

Implements org.apache.bcel.classfile.Node.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.

Parameters
v:Visitor

Visitor object

Annotations
@Override
dumpback to summary
public void dump(final DataOutputStream file) throws IOException

Implements abstract org.apache.bcel.classfile.Constant.dump.

Dump constant integer to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getBytesback to summary
public int getBytes()
Returns:int

data, i.e., 4 bytes.

getConstantValueback to summary
public Object getConstantValue(final ConstantPool cp)

Implements org.apache.bcel.classfile.ConstantObject.getConstantValue.

Doc from org.apache.bcel.classfile.ConstantObject.getConstantValue.

Gets the object representing the constant, e.g., Long for ConstantLong.

Parameters
cp:ConstantPool

the constant.

Returns:Object

Integer object

Annotations
@Override
setBytesback to summary
public void setBytes(final int bytes)
Parameters
bytes:int

the raw bytes that represent this integer

toStringback to summary
public String toString()

Overrides org.apache.bcel.classfile.Constant.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

String representation.

Annotations
@Override