|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.classfile.TypeReference
edu.rit.classfile.PrimitiveReference
public class PrimitiveReference
Class PrimitiveReference encapsulates a reference to a primitive type. Singleton objects are defined for all the Java primitive types.
An instance of class PrimitiveReference can be written to a data output
stream using the write()
method below, and
an instance of class PrimitiveReference can be read from a data input stream
using the static TypeReference.read()
method.
Field Summary | |
---|---|
static PrimitiveReference |
BOOLEAN
The primitive reference object for type boolean. |
static PrimitiveReference |
BYTE
The primitive reference object for type byte. |
static PrimitiveReference |
CHAR
The primitive reference object for type char. |
static PrimitiveReference |
DOUBLE
The primitive reference object for type double. |
static PrimitiveReference |
FLOAT
The primitive reference object for type float. |
static PrimitiveReference |
INT
The primitive reference object for type int. |
static PrimitiveReference |
LONG
The primitive reference object for type long. |
static PrimitiveReference |
SHORT
The primitive reference object for type short. |
Method Summary | |
---|---|
static PrimitiveReference |
forClassName(String theClassName)
Returns the primitive reference corresponding to the given class name. |
static PrimitiveReference |
forDescriptor(char theDescriptor)
Returns the primitive reference corresponding to the given type descriptor character. |
static PrimitiveReference |
forDescriptor(String theDescriptor)
Returns the primitive reference corresponding to the given type descriptor. |
void |
write(DataOutput theDataOutput)
Write this primitive reference to the given data output stream. |
Methods inherited from class edu.rit.classfile.TypeReference |
---|
equals, getTypeDescriptor, getWordCount, hashCode, read, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final PrimitiveReference BYTE
public static final PrimitiveReference CHAR
public static final PrimitiveReference DOUBLE
public static final PrimitiveReference FLOAT
public static final PrimitiveReference INT
public static final PrimitiveReference LONG
public static final PrimitiveReference SHORT
public static final PrimitiveReference BOOLEAN
Method Detail |
---|
public static PrimitiveReference forClassName(String theClassName)
Class Name | PrimitiveReference |
"byte" | BYTE |
"char" | CHAR |
"double" | DOUBLE |
"float" | FLOAT |
"int" | INT |
"long" | LONG |
"short" | SHORT |
"boolean" | BOOLEAN |
theClassName
- Class name as returned by Class.getName().
public static PrimitiveReference forDescriptor(String theDescriptor)
Type Descriptor | PrimitiveReference |
"B" | BYTE |
"C" | CHAR |
"D" | DOUBLE |
"F" | FLOAT |
"I" | INT |
"J" | LONG |
"S" | SHORT |
"Z" | BOOLEAN |
theDescriptor
- Type descriptor.
public static PrimitiveReference forDescriptor(char theDescriptor)
Type Descriptor | PrimitiveReference |
'B' | BYTE |
'C' | CHAR |
'D' | DOUBLE |
'F' | FLOAT |
'I' | INT |
'J' | LONG |
'S' | SHORT |
'Z' | BOOLEAN |
theDescriptor
- Type descriptor character.
public void write(DataOutput theDataOutput) throws IOException
write
in class TypeReference
theDataOutput
- Data output stream to write.
IOException
- Thrown if an I/O error occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |