Methods Summary |
---|
private static int | compareHandlesNulls(com.android.dx.rop.cst.CstString a, com.android.dx.rop.cst.CstString b)Compares two strings like String.compareTo(), excepts treats a null
as the least-possible string value.
if (a == b) {
return 0;
} else if (a == null) {
return -1;
} else if (b == null) {
return 1;
} else {
return a.compareTo(b);
}
|
public int | compareTo(com.android.dx.rop.code.LocalItem local){@inheritDoc}
int ret;
ret = compareHandlesNulls(name, local.name);
if (ret != 0) {
return ret;
}
ret = compareHandlesNulls(signature, local.signature);
return ret;
|
public boolean | equals(java.lang.Object other){@inheritDoc}
if (!(other instanceof LocalItem)) {
return false;
}
LocalItem local = (LocalItem) other;
return 0 == compareTo(local);
|
public com.android.dx.rop.cst.CstString | getName()Gets name.
return name;
|
public com.android.dx.rop.cst.CstString | getSignature()Gets signature.
return signature;
|
public int | hashCode(){@inheritDoc}
return (name == null ? 0 : name.hashCode()) * 31
+ (signature == null ? 0 : signature.hashCode());
|
public static com.android.dx.rop.code.LocalItem | make(com.android.dx.rop.cst.CstString name, com.android.dx.rop.cst.CstString signature)Make a new item. If both name and signature are null, null is returned.
TODO: intern these
if (name == null && signature == null) {
return null;
}
return new LocalItem (name, signature);
|
public java.lang.String | toString(){@inheritDoc}
if (name != null && signature == null) {
return name.toQuoted();
} else if (name == null && signature == null) {
return "";
}
return "[" + (name == null ? "" : name.toQuoted())
+ "|" + (signature == null ? "" : signature.toQuoted());
|