Fields Summary |
---|
public static final StdTypeList | EMPTYnon-null; no-element instance |
public static final StdTypeList | INTnon-null; the list [int] |
public static final StdTypeList | LONGnon-null; the list [long] |
public static final StdTypeList | FLOATnon-null; the list [float] |
public static final StdTypeList | DOUBLEnon-null; the list [double] |
public static final StdTypeList | OBJECTnon-null; the list [Object] |
public static final StdTypeList | RETURN_ADDRESSnon-null; the list [ReturnAddress] |
public static final StdTypeList | THROWABLEnon-null; the list [Throwable] |
public static final StdTypeList | INT_INTnon-null; the list [int, int] |
public static final StdTypeList | LONG_LONGnon-null; the list [long, long] |
public static final StdTypeList | FLOAT_FLOATnon-null; the list [float, float] |
public static final StdTypeList | DOUBLE_DOUBLEnon-null; the list [double, double] |
public static final StdTypeList | OBJECT_OBJECTnon-null; the list [Object, Object] |
public static final StdTypeList | INT_OBJECTnon-null; the list [int, Object] |
public static final StdTypeList | LONG_OBJECTnon-null; the list [long, Object] |
public static final StdTypeList | FLOAT_OBJECTnon-null; the list [float, Object] |
public static final StdTypeList | DOUBLE_OBJECTnon-null; the list [double, Object] |
public static final StdTypeList | LONG_INTnon-null; the list [long, int] |
public static final StdTypeList | INTARR_INTnon-null; the list [int[], int] |
public static final StdTypeList | LONGARR_INTnon-null; the list [long[], int] |
public static final StdTypeList | FLOATARR_INTnon-null; the list [float[], int] |
public static final StdTypeList | DOUBLEARR_INTnon-null; the list [double[], int] |
public static final StdTypeList | OBJECTARR_INTnon-null; the list [Object[], int] |
public static final StdTypeList | BOOLEANARR_INTnon-null; the list [boolean[], int] |
public static final StdTypeList | BYTEARR_INTnon-null; the list [byte[], int] |
public static final StdTypeList | CHARARR_INTnon-null; the list [char[], int] |
public static final StdTypeList | SHORTARR_INTnon-null; the list [short[], int] |
public static final StdTypeList | INT_INTARR_INTnon-null; the list [int, int[], int] |
public static final StdTypeList | LONG_LONGARR_INTnon-null; the list [long, long[], int] |
public static final StdTypeList | FLOAT_FLOATARR_INTnon-null; the list [float, float[], int] |
public static final StdTypeList | DOUBLE_DOUBLEARR_INTnon-null; the list [double, double[], int] |
public static final StdTypeList | OBJECT_OBJECTARR_INTnon-null; the list [Object, Object[], int] |
public static final StdTypeList | INT_BOOLEANARR_INTnon-null; the list [int, boolean[], int] |
public static final StdTypeList | INT_BYTEARR_INTnon-null; the list [int, byte[], int] |
public static final StdTypeList | INT_CHARARR_INTnon-null; the list [int, char[], int] |
public static final StdTypeList | INT_SHORTARR_INTnon-null; the list [int, short[], int] |
Methods Summary |
---|
public static int | compareContents(TypeList list1, TypeList list2)Compares the contents of the given two instances for ordering. This
is a static method so as to work on arbitrary {@link TypeList}
instances.
int size1 = list1.size();
int size2 = list2.size();
int size = Math.min(size1, size2);
for (int i = 0; i < size; i++) {
int comparison = list1.getType(i).compareTo(list2.getType(i));
if (comparison != 0) {
return comparison;
}
}
if (size1 == size2) {
return 0;
} else if (size1 < size2) {
return -1;
} else {
return 1;
}
|
public static boolean | equalContents(TypeList list1, TypeList list2)Compares the contents of the given two instances for equality. This
is a static method so as to work on arbitrary {@link TypeList}
instances.
int size = list1.size();
if (list2.size() != size) {
return false;
}
for (int i = 0; i < size; i++) {
if (! list1.getType(i).equals(list2.getType(i))) {
return false;
}
}
return true;
|
public Type | get(int n)Gets the indicated element. It is an error to call this with the
index for an element which was never set; if you do that, this
will throw NullPointerException .
return (Type) get0(n);
|
public Type | getType(int n){@inheritDoc}
return get(n);
|
public int | getWordCount(){@inheritDoc}
int sz = size();
int result = 0;
for (int i = 0; i < sz; i++) {
result += get(i).getCategory();
}
return result;
|
public static int | hashContents(TypeList list)Returns a hashcode of the contents of the given list. This
is a static method so as to work on arbitrary {@link TypeList}
instances.
int size = list.size();
int hash = 0;
for (int i = 0; i < size; i++) {
hash = (hash * 31) + list.getType(i).hashCode();
}
return hash;
|
public static com.android.dx.rop.type.StdTypeList | make(Type type)Makes a single-element instance.
StdTypeList result = new StdTypeList(1);
result.set(0, type);
return result;
|
public static com.android.dx.rop.type.StdTypeList | make(Type type0, Type type1)Makes a two-element instance.
StdTypeList result = new StdTypeList(2);
result.set(0, type0);
result.set(1, type1);
return result;
|
public static com.android.dx.rop.type.StdTypeList | make(Type type0, Type type1, Type type2)Makes a three-element instance.
StdTypeList result = new StdTypeList(3);
result.set(0, type0);
result.set(1, type1);
result.set(2, type2);
return result;
|
public static com.android.dx.rop.type.StdTypeList | make(Type type0, Type type1, Type type2, Type type3)Makes a four-element instance.
StdTypeList result = new StdTypeList(4);
result.set(0, type0);
result.set(1, type1);
result.set(2, type2);
result.set(3, type3);
return result;
|
public void | set(int n, Type type)Sets the type at the given index.
set0(n, type);
|
public static java.lang.String | toHuman(TypeList list)Returns the given list as a comma-separated list of human forms. This
is a static method so as to work on arbitrary {@link TypeList}
instances.
int size = list.size();
if (size == 0) {
return "<empty>";
}
StringBuffer sb = new StringBuffer(100);
for (int i = 0; i < size; i++) {
if (i != 0) {
sb.append(", ");
}
sb.append(list.getType(i).toHuman());
}
return sb.toString();
|
public TypeList | withAddedType(Type type){@inheritDoc}
int sz = size();
StdTypeList result = new StdTypeList(sz + 1);
for (int i = 0; i < sz; i++) {
result.set0(i, get0(i));
}
result.set(sz, type);
result.setImmutable();
return result;
|
public com.android.dx.rop.type.StdTypeList | withFirst(Type type)Returns a new instance, which is the same as this instance,
except that it has an additional type prepended to the
original.
int sz = size();
StdTypeList result = new StdTypeList(sz + 1);
result.set0(0, type);
for (int i = 0; i < sz; i++) {
result.set0(i + 1, getOrNull0(i));
}
return result;
|