edu.rice.cs.cunit.classFile.attributes
Class AAnnotationsAttributeInfo.Annotation

java.lang.Object
  extended by edu.rice.cs.cunit.classFile.attributes.AAnnotationsAttributeInfo.Annotation
Enclosing class:
AAnnotationsAttributeInfo

public static class AAnnotationsAttributeInfo.Annotation
extends java.lang.Object

Storage class for annotations.


Nested Class Summary
static class AAnnotationsAttributeInfo.Annotation.ADefaultMemberValueVisitor<R,P>
          Default visitor where all cases delegate to an abstract default case.
static class AAnnotationsAttributeInfo.Annotation.AMemberValue
          Storage class for a member value.
static class AAnnotationsAttributeInfo.Annotation.AnnotationMemberValue
          Storage class for an annotation value.
static class AAnnotationsAttributeInfo.Annotation.ArrayMemberValue
          Storage class for an array.
static class AAnnotationsAttributeInfo.Annotation.CheckConstantMemberVisitor
           
static class AAnnotationsAttributeInfo.Annotation.ClassMemberValue
          Storage class for a class value.
static class AAnnotationsAttributeInfo.Annotation.ConstantMemberValue
          Storage class for constants.
static class AAnnotationsAttributeInfo.Annotation.EnumMemberValue
          Storage class for an enum.
static interface AAnnotationsAttributeInfo.Annotation.IMemberValueVisitor<R,P>
          Visitor interface for member values.
static class AAnnotationsAttributeInfo.Annotation.NameValuePair
          Storage class for a name-value pair.
 
Field Summary
private  int _pairCount
          Number of stored name-value _pairs.
private  AAnnotationsAttributeInfo.Annotation.NameValuePair[] _pairs
          Name-value _pairs.
private  AUTFPoolInfo _type
          Type name of annotation.
 
Constructor Summary
AAnnotationsAttributeInfo.Annotation(AUTFPoolInfo type, short pairCount, AAnnotationsAttributeInfo.Annotation.NameValuePair[] pairs)
          Creates a new annotation.
AAnnotationsAttributeInfo.Annotation(ConstantPool cp, byte[] data, int start)
          Creates a new annotation.
 
Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this one.
 java.util.List<AAnnotationsAttributeInfo.Annotation.NameValuePair> getPairs()
          Returns a list of the pairs.
 int getSize()
          Returns the size of this annotation.
 java.lang.String getType()
          Returns the type of the annotation.
 int hashCode()
          Returns a hash code value for the object.
 java.lang.String toString()
          Returns a string representation of the object.
 java.lang.String toStringJava()
          Returns a string representation of the object like it would be seen in a Java listing.
 void writeToByteArrayOutputStream(ConstantPool cp, java.io.ByteArrayOutputStream baos)
          Writes this annotation into the stream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_type

private AUTFPoolInfo _type
Type name of annotation.


_pairCount

private int _pairCount
Number of stored name-value _pairs.


_pairs

private AAnnotationsAttributeInfo.Annotation.NameValuePair[] _pairs
Name-value _pairs.

Constructor Detail

AAnnotationsAttributeInfo.Annotation

public AAnnotationsAttributeInfo.Annotation(AUTFPoolInfo type,
                                            short pairCount,
                                            AAnnotationsAttributeInfo.Annotation.NameValuePair[] pairs)
Creates a new annotation.

Parameters:
type - name of _type
pairCount - number of name-value _pairs
pairs - array of name-value _pairs

AAnnotationsAttributeInfo.Annotation

public AAnnotationsAttributeInfo.Annotation(ConstantPool cp,
                                            byte[] data,
                                            int start)
Creates a new annotation.

Parameters:
cp - constant pool
data - data array
start - start index in data array
Method Detail

getSize

public int getSize()
Returns the size of this annotation.

Returns:
size in bytes

writeToByteArrayOutputStream

public void writeToByteArrayOutputStream(ConstantPool cp,
                                         java.io.ByteArrayOutputStream baos)
                                  throws java.io.IOException
Writes this annotation into the stream.

Parameters:
cp - constant pool
baos - stream
Throws:
java.io.IOException

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.

toStringJava

public java.lang.String toStringJava()
Returns a string representation of the object like it would be seen in a Java listing.

Returns:
a string representation of the object.

getType

public java.lang.String getType()
Returns the type of the annotation.

Returns:
_type string

getPairs

public java.util.List<AAnnotationsAttributeInfo.Annotation.NameValuePair> getPairs()
Returns a list of the pairs.

Returns:
list of name-value pairs.

equals

public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.