Lines Matching refs:cst

22 import com.android.dx.rop.cst.Constant;
23 import com.android.dx.rop.cst.CstAnnotation;
24 import com.android.dx.rop.cst.CstArray;
25 import com.android.dx.rop.cst.CstBoolean;
26 import com.android.dx.rop.cst.CstByte;
27 import com.android.dx.rop.cst.CstChar;
28 import com.android.dx.rop.cst.CstDouble;
29 import com.android.dx.rop.cst.CstEnumRef;
30 import com.android.dx.rop.cst.CstFieldRef;
31 import com.android.dx.rop.cst.CstFloat;
32 import com.android.dx.rop.cst.CstInteger;
33 import com.android.dx.rop.cst.CstKnownNull;
34 import com.android.dx.rop.cst.CstLiteralBits;
35 import com.android.dx.rop.cst.CstLong;
36 import com.android.dx.rop.cst.CstMethodRef;
37 import com.android.dx.rop.cst.CstShort;
38 import com.android.dx.rop.cst.CstString;
39 import com.android.dx.rop.cst.CstType;
125 * @param cst {@code non-null;} the constant to write
127 public void writeConstant(Constant cst) {
128 int type = constantToValueType(cst);
136 long value = ((CstLiteralBits) cst).getLongBits();
141 long value = ((CstLiteralBits) cst).getLongBits();
147 long value = ((CstFloat) cst).getLongBits() << 32;
152 long value = ((CstDouble) cst).getLongBits();
157 int index = file.getStringIds().indexOf((CstString) cst);
162 int index = file.getTypeIds().indexOf((CstType) cst);
167 int index = file.getFieldIds().indexOf((CstFieldRef) cst);
172 int index = file.getMethodIds().indexOf((CstMethodRef) cst);
177 CstFieldRef fieldRef = ((CstEnumRef) cst).getFieldRef();
184 writeArray((CstArray) cst, false);
189 writeAnnotation(((CstAnnotation) cst).getAnnotation(),
198 int value = ((CstBoolean) cst).getIntBits();
211 * @param cst {@code non-null;} the constant
215 private static int constantToValueType(Constant cst) {
220 if (cst instanceof CstByte) {
222 } else if (cst instanceof CstShort) {
224 } else if (cst instanceof CstChar) {
226 } else if (cst instanceof CstInteger) {
228 } else if (cst instanceof CstLong) {
230 } else if (cst instanceof CstFloat) {
232 } else if (cst instanceof CstDouble) {
234 } else if (cst instanceof CstString) {
236 } else if (cst instanceof CstType) {
238 } else if (cst instanceof CstFieldRef) {
240 } else if (cst instanceof CstMethodRef) {
242 } else if (cst instanceof CstEnumRef) {
244 } else if (cst instanceof CstArray) {
246 } else if (cst instanceof CstAnnotation) {
248 } else if (cst instanceof CstKnownNull) {
250 } else if (cst instanceof CstBoolean) {
282 Constant cst = list.get(i);
285 constantToHuman(cst));
287 writeConstant(cst);
363 * @param cst {@code non-null;} the constant
366 public static String constantToHuman(Constant cst) {
367 int type = constantToValueType(cst);
375 sb.append(cst.typeName());
377 sb.append(cst.toHuman());
410 * @param cst {@code non-null;} the constant to add contents for
412 public static void addContents(DexFile file, Constant cst) {
413 if (cst instanceof CstAnnotation) {
414 addContents(file, ((CstAnnotation) cst).getAnnotation());
415 } else if (cst instanceof CstArray) {
416 CstArray.List list = ((CstArray) cst).getList();
422 file.internIfAppropriate(cst);