本文整理汇总了Java中com.sun.squawk.vm.CID.ADDRESS属性的典型用法代码示例。如果您正苦于以下问题:Java CID.ADDRESS属性的具体用法?Java CID.ADDRESS怎么用?Java CID.ADDRESS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.squawk.vm.CID
的用法示例。
在下文中一共展示了CID.ADDRESS属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLocalTypeFor
/**
* Gets the type of a local variable that is used to store a value of a
* given class. This method partitions all classes into one of the
* following categories:
* <p><blockquote><pre>
*
* Local Variable Type | Types
* ---------------------+-------
* INT | boolean, byte, short, int
* FLOAT | float
* LONG | long
* DOUBLE | double
* ADDRESS | Address
* UWORD | UWord
* OFFSET | Offset
* REFERENCE | types in java.lang.Object hierarchy
*
* </pre></blockquote><p>
*
* @param type the type of a value that will be stored in a local variable
* @return the local variable type for storing values of type <code>type</code>
*/
public static Klass getLocalTypeFor(Klass type) {
switch (type.getSystemID()) {
case CID.BOOLEAN:
case CID.BYTE:
case CID.SHORT:
case CID.CHAR:
case CID.INT: {
return Klass.INT;
}
case CID.FLOAT:
case CID.LONG:
case CID.DOUBLE: {
return type;
}
case CID.UWORD:
case CID.OFFSET:
case CID.ADDRESS: {
return type;
}
default: {
Assert.that(Klass.REFERENCE.isAssignableFrom(type));
return Klass.REFERENCE;
}
}
}