|
||||||||||
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.ArrayOrClassReference
edu.rit.classfile.ArrayReference
public class ArrayReference
Class ArrayReference encapsulates the information needed to refer to an array type. This includes the array's component type and number of dimensions. In the documentation below, the term "referenced type" means "the array type referred to by this type reference object."
An instance of class ArrayReference can be written to a data output stream
using the write()
method below, and an
instance of class ArrayReference can be read from a data input stream using
the static TypeReference.read()
method.
Constructor Summary | |
---|---|
ArrayReference(TypeReference theComponentType,
int theDimensions)
Construct a new array reference with the given component type and dimensions. |
Method Summary | |
---|---|
static ArrayReference |
forClassName(String theClassName)
Returns an array reference corresponding to the given class name. |
TypeReference |
getComponentType()
Returns the referenced type's component type. |
int |
getDimensions()
Returns the referenced type's number of dimensions. |
void |
write(DataOutput theDataOutput)
Write this array reference to the given data output stream. |
Methods inherited from class edu.rit.classfile.ArrayOrClassReference |
---|
getClassInternalName |
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 |
Constructor Detail |
---|
public ArrayReference(TypeReference theComponentType, int theDimensions) throws OutOfRangeException
theComponentType
- Component type.theDimensions
- Number of dimensions.
NullPointerException
- (unchecked exception) Thrown if theComponentType is null.
OutOfRangeException
- Thrown if theDimensions is not in the range 1 .. 255.Method Detail |
---|
public TypeReference getComponentType()
public int getDimensions()
public static ArrayReference forClassName(String theClassName)
theClassName
- Class name as returned by Class.getName().
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. In particular, a
NotSerializableException
is thrown if this array
reference's component type reference is not an instance of one of the
subclasses that can be written.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |