edu.rice.cs.cunit.classFile.attributes
Class AMultipleNamedAnnotationsAttributeInfo

java.lang.Object
  extended by edu.rice.cs.cunit.classFile.attributes.AAttributeInfo
      extended by edu.rice.cs.cunit.classFile.attributes.AAnnotationsAttributeInfo
          extended by edu.rice.cs.cunit.classFile.attributes.AMultipleNamedAnnotationsAttributeInfo
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
RuntimeInvisibleLocalVariableAnnotationsAttributeInfo, RuntimeVisibleLocalVariableAnnotationsAttributeInfo

public abstract class AMultipleNamedAnnotationsAttributeInfo
extends AAnnotationsAttributeInfo

Author:
Mathias Ricken

Nested Class Summary
static class AMultipleNamedAnnotationsAttributeInfo.NamedAnnotationsRecord
          Storage class for name and annotations.
 
Nested classes/interfaces inherited from class edu.rice.cs.cunit.classFile.attributes.AAnnotationsAttributeInfo
AAnnotationsAttributeInfo.Annotation
 
Field Summary
 
Fields inherited from class edu.rice.cs.cunit.classFile.attributes.AAttributeInfo
_constantPool, _data, _name
 
Constructor Summary
AMultipleNamedAnnotationsAttributeInfo(AUTFPoolInfo name, byte[] data, ConstantPool cp)
           
 
Method Summary
 void adjustPC(int startPC, int deltaPC)
          Adjust program counter values contained in this attribute, starting at startPC, by adding deltaPC to them.
 java.lang.Object clone()
          Creates and returns a copy of this object.
 AMultipleNamedAnnotationsAttributeInfo.NamedAnnotationsRecord[] getEntityAnnotations()
          Return an array of entity annotations records.
 int getEntityCount()
          Return the number of entities.
abstract  java.lang.String getEntityName()
          Return the name of the entity, e.g.
 void setLocalVariableAnnotations(AMultipleNamedAnnotationsAttributeInfo.NamedAnnotationsRecord[] nars)
          Set the array of entity annotations records.
 java.lang.String toString()
          Return a human-readable version of this attribute.
 void translatePC(int index, int deltaIndex, LineNumberTable oldLnt, LineNumberTable newLnt)
          Translate the program counter values contained in this attribute from an old line number table to a new one.
 
Methods inherited from class edu.rice.cs.cunit.classFile.attributes.AAttributeInfo
equals, execute, getData, getName, hashCode, read, setData, setName, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AMultipleNamedAnnotationsAttributeInfo

public AMultipleNamedAnnotationsAttributeInfo(AUTFPoolInfo name,
                                              byte[] data,
                                              ConstantPool cp)
Method Detail

getEntityCount

public int getEntityCount()
Return the number of entities.

Returns:
number of entities
Throws:
java.lang.ClassFormatError

getEntityAnnotations

public AMultipleNamedAnnotationsAttributeInfo.NamedAnnotationsRecord[] getEntityAnnotations()
                                                                                     throws java.lang.ClassFormatError
Return an array of entity annotations records.

Returns:
array of entity annotations records.
Throws:
java.lang.ClassFormatError - if the attribute has an incorrect format

setLocalVariableAnnotations

public void setLocalVariableAnnotations(AMultipleNamedAnnotationsAttributeInfo.NamedAnnotationsRecord[] nars)
Set the array of entity annotations records.

Parameters:
nars - array of entity annotations records

toString

public java.lang.String toString()
Return a human-readable version of this attribute.

Overrides:
toString in class AAttributeInfo
Returns:
string

getEntityName

public abstract java.lang.String getEntityName()
Return the name of the entity, e.g. "parameter" or "local variable".

Returns:
name of tne entity

adjustPC

public void adjustPC(int startPC,
                     int deltaPC)
Adjust program counter values contained in this attribute, starting at startPC, by adding deltaPC to them.

Overrides:
adjustPC in class AAnnotationsAttributeInfo
Parameters:
startPC - program counter to start at
deltaPC - change in program counter values

translatePC

public void translatePC(int index,
                        int deltaIndex,
                        LineNumberTable oldLnt,
                        LineNumberTable newLnt)
Translate the program counter values contained in this attribute from an old line number table to a new one.

Overrides:
translatePC in class AAnnotationsAttributeInfo
Parameters:
index - critical point (insertion or deletion point)
deltaIndex - delta value to add to all old line numbers greater than the critical point
oldLnt - old line number table
newLnt - new line number table

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class AAnnotationsAttributeInfo
Throws:
java.lang.CloneNotSupportedException