Methods Summary |
---|
public IndexedItem | get(com.android.dx.rop.cst.Constant cst){@inheritDoc}
if (cst == null) {
throw new NullPointerException("cst == null");
}
throwIfNotPrepared();
IndexedItem result = strings.get((CstString) cst);
if (result == null) {
throw new IllegalArgumentException("not found");
}
return result;
|
public int | indexOf(com.android.dx.rop.cst.CstString string)Gets the index of the given string, which must have been added
to this instance.
if (string == null) {
throw new NullPointerException("string == null");
}
throwIfNotPrepared();
StringIdItem s = strings.get(string);
if (s == null) {
throw new IllegalArgumentException("not found");
}
return s.getIndex();
|
public StringIdItem | intern(java.lang.String string)Interns an element into this instance.
return intern(new StringIdItem(new CstString(string)));
|
public StringIdItem | intern(com.android.dx.rop.cst.CstString string)Interns an element into this instance.
return intern(new StringIdItem(string));
|
public StringIdItem | intern(StringIdItem string)Interns an element into this instance.
if (string == null) {
throw new NullPointerException("string == null");
}
throwIfPrepared();
CstString value = string.getValue();
StringIdItem already = strings.get(value);
if (already != null) {
return already;
}
strings.put(value, string);
return string;
|
public void | intern(com.android.dx.rop.cst.CstNat nat)Interns the components of a name-and-type into this instance.
intern(nat.getName());
intern(nat.getDescriptor());
|
public java.util.Collection | items(){@inheritDoc}
return strings.values();
|
protected void | orderItems(){@inheritDoc}
int idx = 0;
for (StringIdItem s : strings.values()) {
s.setIndex(idx);
idx++;
}
|
public void | writeHeaderPart(com.android.dx.util.AnnotatedOutput out)Writes the portion of the file header that refers to this instance.
throwIfNotPrepared();
int sz = strings.size();
int offset = (sz == 0) ? 0 : getFileOffset();
if (out.annotates()) {
out.annotate(4, "string_ids_size: " + Hex.u4(sz));
out.annotate(4, "string_ids_off: " + Hex.u4(offset));
}
out.writeInt(sz);
out.writeInt(offset);
|