Methods Summary |
---|
public void | add(NameValuePair pair)Add an element to the set of (name, value) pairs for this instance.
It is an error to call this method if there is a preexisting element
with the same name.
throwIfImmutable();
if (pair == null) {
throw new NullPointerException("pair == null");
}
CstUtf8 name = pair.getName();
if (elements.get(name) != null) {
throw new IllegalArgumentException("name already added: " + name);
}
elements.put(name, pair);
|
public int | compareTo(com.android.dexgen.rop.annotation.Annotation other){@inheritDoc}
int result = type.compareTo(other.type);
if (result != 0) {
return result;
}
result = visibility.compareTo(other.visibility);
if (result != 0) {
return result;
}
Iterator<NameValuePair> thisIter = elements.values().iterator();
Iterator<NameValuePair> otherIter = other.elements.values().iterator();
while (thisIter.hasNext() && otherIter.hasNext()) {
NameValuePair thisOne = thisIter.next();
NameValuePair otherOne = otherIter.next();
result = thisOne.compareTo(otherOne);
if (result != 0) {
return result;
}
}
if (thisIter.hasNext()) {
return 1;
} else if (otherIter.hasNext()) {
return -1;
}
return 0;
|
public boolean | equals(java.lang.Object other){@inheritDoc}
if (! (other instanceof Annotation)) {
return false;
}
Annotation otherAnnotation = (Annotation) other;
if (! (type.equals(otherAnnotation.type)
&& (visibility == otherAnnotation.visibility))) {
return false;
}
return elements.equals(otherAnnotation.elements);
|
public java.util.Collection | getNameValuePairs()Gets the set of name-value pairs contained in this instance. The
result is always unmodifiable.
return Collections.unmodifiableCollection(elements.values());
|
public com.android.dexgen.rop.cst.CstType | getType()Gets the type of this instance.
return type;
|
public AnnotationVisibility | getVisibility()Gets the visibility of this instance.
return visibility;
|
public int | hashCode(){@inheritDoc}
int hash = type.hashCode();
hash = (hash * 31) + elements.hashCode();
hash = (hash * 31) + visibility.hashCode();
return hash;
|
public void | put(NameValuePair pair)Put an element into the set of (name, value) pairs for this instance.
If there is a preexisting element with the same name, it will be
replaced by this method.
throwIfImmutable();
if (pair == null) {
throw new NullPointerException("pair == null");
}
elements.put(pair.getName(), pair);
|
public java.lang.String | toHuman(){@inheritDoc}
StringBuilder sb = new StringBuilder();
sb.append(visibility.toHuman());
sb.append("-annotation ");
sb.append(type.toHuman());
sb.append(" {");
boolean first = true;
for (NameValuePair pair : elements.values()) {
if (first) {
first = false;
} else {
sb.append(", ");
}
sb.append(pair.getName().toHuman());
sb.append(": ");
sb.append(pair.getValue().toHuman());
}
sb.append("}");
return sb.toString();
|
public java.lang.String | toString(){@inheritDoc}
return toHuman();
|