|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.classfile.TypeReference
public abstract class TypeReference
Class TypeReference encapsulates the information needed to refer to a type. This includes the type's name. In the documentation below, the term "referenced type" means "the type referred to by this type reference object."
Class TypeReference and its subclasses are not serializable and cannot be
written to an object output stream using writeObject(), or read from
an object input stream using readObject(). However, instances of
certain subclasses of class TypeReference can be written to a data
output stream using the write()
method
below, and instances of these subclasses can be read from a data
input stream using the static read()
method
below. The subclasses that can be written and read in this way are ArrayReference
,
NamedClassReference
, and
PrimitiveReference
.
Method Summary | |
---|---|
boolean |
equals(Object obj)
Determine if this type reference is equal to the given object. |
String |
getTypeDescriptor()
Returns the referenced type's type descriptor. |
int |
getWordCount()
Returns the number of virtual machine words needed to hold an object of the referenced type. |
int |
hashCode()
Returns a hash code for this type reference. |
static TypeReference |
read(DataInput theDataInput)
Read a type reference from the given data input stream. |
String |
toString()
Returns a string version of this type reference. |
void |
write(DataOutput theDataOutput)
Write this type reference to the given data output stream. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public String getTypeDescriptor()
public int getWordCount()
public void write(DataOutput theDataOutput) throws IOException
theDataOutput
- Data output stream to write.
IOException
- Thrown if an I/O error occurred. In particular, a
NotSerializableException
is thrown if this type
reference is not an instance of one of the subclasses that can be
written.public static TypeReference read(DataInput theDataInput) throws IOException
theDataInput
- Data input stream to read.
IOException
- Thrown if an I/O error occurred.public boolean equals(Object obj)
equals
in class Object
obj
- Object to test.
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |