public final class ConstantIntegerInfo extends CPInfo
ConstantIntegerInfo
denotes a CONSTANT_Integer_info structure in the constant_pool of a ClassFile structure.
The CONSTANT_Integer_info structure was added to Java in version 1.0.2.
This class is not thread-safe.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
The name of the CONSTANT_Integer_info structure.
|
static int |
TAG
The tag for CONSTANT_Integer.
|
Modifier and Type | Method and Description |
---|---|
ConstantIntegerInfo |
copy()
Returns a copy of this
ConstantIntegerInfo instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of ConstantIntegerInfo , and that ConstantIntegerInfo instance is equal to this ConstantIntegerInfo instance, false
otherwise. |
static java.util.List<ConstantIntegerInfo> |
filter(Node node)
Returns a
List with all ConstantIntegerInfo s. |
int |
getInt()
Returns an
int representation of this ConstantIntegerInfo instance. |
int |
hashCode()
Returns a hash code for this
ConstantIntegerInfo instance. |
static ConstantIntegerInfo |
newInstance(int value)
Returns a new
ConstantIntegerInfo . |
void |
setInt(int value)
Sets a new
int representation for this ConstantIntegerInfo instance. |
java.lang.String |
toString()
Returns a
String representation of this ConstantIntegerInfo instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
ConstantIntegerInfo to dataOutput . |
void |
write(Document document)
Writes this
ConstantIntegerInfo to document . |
getConstantPoolEntryCount, getName, getTag
public static final java.lang.String NAME
public static final int TAG
public ConstantIntegerInfo copy()
ConstantIntegerInfo
instance.public java.lang.String toString()
String
representation of this ConstantIntegerInfo
instance.toString
in class java.lang.Object
String
representation of this ConstantIntegerInfo
instancepublic boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of ConstantIntegerInfo
, and that ConstantIntegerInfo
instance is equal to this ConstantIntegerInfo
instance, false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this ConstantIntegerInfo
instance for equalitytrue
if, and only if, object
is an instance of ConstantIntegerInfo
, and that ConstantIntegerInfo
instance is equal to this ConstantIntegerInfo
instance, false
otherwisepublic int hashCode()
ConstantIntegerInfo
instance.hashCode
in class java.lang.Object
ConstantIntegerInfo
instancepublic int getInt()
int
representation of this ConstantIntegerInfo
instance.int
representation of this ConstantIntegerInfo
instancepublic void setInt(int value)
int
representation for this ConstantIntegerInfo
instance.value
- the new int
representationpublic void write(java.io.DataOutput dataOutput)
ConstantIntegerInfo
to dataOutput
.
If dataOutput
is an OutputStream
(or any other type of stream), this method will not close it.
If dataOutput
is null
, a NullPointerException
will be thrown.
If an I/O-error occurs, an UncheckedIOException
will be thrown.
public void write(Document document)
ConstantIntegerInfo
to document
.
If document
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
public static ConstantIntegerInfo newInstance(int value)
ConstantIntegerInfo
.value
- the int
representation of the new ConstantIntegerInfo
instanceConstantIntegerInfo
public static java.util.List<ConstantIntegerInfo> filter(Node node)
List
with all ConstantIntegerInfo
s.
All ConstantIntegerInfo
s are found by traversing node
using a simple NodeHierarchicalVisitor
implementation.
If node
is null
, a NullPointerException
will be thrown.
node
- the Node
to start traversal fromList
with all ConstantIntegerInfo
sjava.lang.NullPointerException
- thrown if, and only if, node
is null