org.ow2.asmdex.structureWriter
Class AnnotationSetItem

java.lang.Object
  extended by org.ow2.asmdex.structureWriter.AnnotationSetItem
All Implemented Interfaces:
java.lang.Comparable<AnnotationSetItem>

public class AnnotationSetItem
extends java.lang.Object
implements java.lang.Comparable<AnnotationSetItem>

An Annotation_set_item. It is only useful when the Application is fully parsed, and is being written as a Dex file. The purpose of this Class is to have a collection of annotation_item that is sorted by increasing type_idx. The uniqueness of this Class is also important when encoding it. An annotation_set_item is used to assign one or several Annotations to an Item : @MyAnnotation(...) @MyAnnotation2(...) myItem. The fact that the Annotations are composed of several fields (@ myAnnotation(int a, boolean b, float c...) is handled by annotation_item, not annotation_set_item.

Author:
Julien Névo

Constructor Summary
AnnotationSetItem()
           
 
Method Summary
 void addAnnotationItem(AnnotationItem annotationItem)
          Adds an annotation_item to the annotation_set_item, ordered by type_idx.
 int compareTo(AnnotationSetItem asi)
           
 boolean equals(java.lang.Object o)
           
 java.util.TreeSet<AnnotationItem> getAnnotationItems()
          Returns the sorted Set of annotation_items.
 int getNbAnnotationItems()
          Return the count of annotation_items present in this set.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationSetItem

public AnnotationSetItem()
Method Detail

addAnnotationItem

public void addAnnotationItem(AnnotationItem annotationItem)
Adds an annotation_item to the annotation_set_item, ordered by type_idx.


getAnnotationItems

public java.util.TreeSet<AnnotationItem> getAnnotationItems()
Returns the sorted Set of annotation_items.

Returns:
annotaion items

getNbAnnotationItems

public int getNbAnnotationItems()
Return the count of annotation_items present in this set.

Returns:
positive or 0

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(AnnotationSetItem asi)
Specified by:
compareTo in interface java.lang.Comparable<AnnotationSetItem>