Fields Summary |
---|
public static final StdTypeList | EMPTY{@code non-null;} no-element instance |
public static final StdTypeList | INT{@code non-null;} the list {@code [int]} |
public static final StdTypeList | LONG{@code non-null;} the list {@code [long]} |
public static final StdTypeList | FLOAT{@code non-null;} the list {@code [float]} |
public static final StdTypeList | DOUBLE{@code non-null;} the list {@code [double]} |
public static final StdTypeList | OBJECT{@code non-null;} the list {@code [Object]} |
public static final StdTypeList | RETURN_ADDRESS{@code non-null;} the list {@code [ReturnAddress]} |
public static final StdTypeList | THROWABLE{@code non-null;} the list {@code [Throwable]} |
public static final StdTypeList | INT_INT{@code non-null;} the list {@code [int, int]} |
public static final StdTypeList | LONG_LONG{@code non-null;} the list {@code [long, long]} |
public static final StdTypeList | FLOAT_FLOAT{@code non-null;} the list {@code [float, float]} |
public static final StdTypeList | DOUBLE_DOUBLE{@code non-null;} the list {@code [double, double]} |
public static final StdTypeList | OBJECT_OBJECT{@code non-null;} the list {@code [Object, Object]} |
public static final StdTypeList | INT_OBJECT{@code non-null;} the list {@code [int, Object]} |
public static final StdTypeList | LONG_OBJECT{@code non-null;} the list {@code [long, Object]} |
public static final StdTypeList | FLOAT_OBJECT{@code non-null;} the list {@code [float, Object]} |
public static final StdTypeList | DOUBLE_OBJECT{@code non-null;} the list {@code [double, Object]} |
public static final StdTypeList | LONG_INT{@code non-null;} the list {@code [long, int]} |
public static final StdTypeList | INTARR_INT{@code non-null;} the list {@code [int[], int]} |
public static final StdTypeList | LONGARR_INT{@code non-null;} the list {@code [long[], int]} |
public static final StdTypeList | FLOATARR_INT{@code non-null;} the list {@code [float[], int]} |
public static final StdTypeList | DOUBLEARR_INT{@code non-null;} the list {@code [double[], int]} |
public static final StdTypeList | OBJECTARR_INT{@code non-null;} the list {@code [Object[], int]} |
public static final StdTypeList | BOOLEANARR_INT{@code non-null;} the list {@code [boolean[], int]} |
public static final StdTypeList | BYTEARR_INT{@code non-null;} the list {@code [byte[], int]} |
public static final StdTypeList | CHARARR_INT{@code non-null;} the list {@code [char[], int]} |
public static final StdTypeList | SHORTARR_INT{@code non-null;} the list {@code [short[], int]} |
public static final StdTypeList | INT_INTARR_INT{@code non-null;} the list {@code [int, int[], int]} |
public static final StdTypeList | LONG_LONGARR_INT{@code non-null;} the list {@code [long, long[], int]} |
public static final StdTypeList | FLOAT_FLOATARR_INT{@code non-null;} the list {@code [float, float[], int]} |
public static final StdTypeList | DOUBLE_DOUBLEARR_INT{@code non-null;} the list {@code [double, double[], int]} |
public static final StdTypeList | OBJECT_OBJECTARR_INT{@code non-null;} the list {@code [Object, Object[], int]} |
public static final StdTypeList | INT_BOOLEANARR_INT{@code non-null;} the list {@code [int, boolean[], int]} |
public static final StdTypeList | INT_BYTEARR_INT{@code non-null;} the list {@code [int, byte[], int]} |
public static final StdTypeList | INT_CHARARR_INT{@code non-null;} the list {@code [int, char[], int]} |
public static final StdTypeList | INT_SHORTARR_INT{@code non-null;} the list {@code [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 {@code 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.dexgen.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.dexgen.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.dexgen.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.dexgen.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.dexgen.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;
|