Lines Matching defs:value
39 * Returns a rop constant for the specified value.
41 * @param value null, a boxed primitive, String, Class, or TypeId.
43 static TypedConstant getConstant(Object value) {
44 if (value == null) {
46 } else if (value instanceof Boolean) {
47 return CstBoolean.make((Boolean) value);
48 } else if (value instanceof Byte) {
49 return CstByte.make((Byte) value);
50 } else if (value instanceof Character) {
51 return CstChar.make((Character) value);
52 } else if (value instanceof Double) {
53 return CstDouble.make(Double.doubleToLongBits((Double) value));
54 } else if (value instanceof Float) {
55 return CstFloat.make(Float.floatToIntBits((Float) value));
56 } else if (value instanceof Integer) {
57 return CstInteger.make((Integer) value);
58 } else if (value instanceof Long) {
59 return CstLong.make((Long) value);
60 } else if (value instanceof Short) {
61 return CstShort.make((Short) value);
62 } else if (value instanceof String) {
63 return new CstString((String) value);
64 } else if (value instanceof Class) {
65 return new CstType(TypeId.get((Class<?>) value).ropType);
66 } else if (value instanceof TypeId) {
67 return new CstType(((TypeId) value).ropType);
69 throw new UnsupportedOperationException("Not a constant: " + value);