本文整理汇总了Java中com.jme3.export.InputCapsule.readByte方法的典型用法代码示例。如果您正苦于以下问题:Java InputCapsule.readByte方法的具体用法?Java InputCapsule.readByte怎么用?Java InputCapsule.readByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.export.InputCapsule
的用法示例。
在下文中一共展示了InputCapsule.readByte方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
type = ic.readByte("type", (byte) 0);
switch (type) {
case 0:
value = ic.readInt("intVal", 0);
break;
case 1:
value = ic.readFloat("floatVal", 0f);
break;
case 2:
value = ic.readBoolean("boolVal", false);
break;
case 3:
value = ic.readString("strVal", null);
break;
case 4:
value = ic.readLong("longVal", 0l);
break;
default:
throw new UnsupportedOperationException();
}
}
示例2: read
import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
@Override
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
type = ic.readByte("t", (byte) 0);
switch (type) {
case ARRAY_BYTE:
value = ic.readByteArray("v", null);
break;
case ARRAY_SHORT:
value = ic.readShortArray("v", null);
break;
case ARRAY_INTEGER:
value = ic.readIntArray("v", null);
break;
case ARRAY_FLOAT:
value = ic.readFloatArray("v", null);
break;
case ARRAY_LONG:
value = ic.readLongArray("v", null);
break;
case ARRAY_DOUBLE:
value = ic.readDoubleArray("v", null);
break;
case ARRAY_BOOLEAN:
value = ic.readBooleanArray("v", null);
break;
default :
throw new UnsupportedOperationException("Unknown type of stored data: " + type);
}
}
示例3: read
import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
@Override
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
value = ic.readByte("v", (byte) 0);
}
示例4: read
import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
type = ic.readByte("type", (byte) 0);
switch (type) {
case TYPE_INTEGER:
value = ic.readInt("intVal", 0);
break;
case TYPE_FLOAT:
value = ic.readFloat("floatVal", 0f);
break;
case TYPE_BOOLEAN:
value = ic.readBoolean("boolVal", false);
break;
case TYPE_STRING:
value = ic.readString("strVal", null);
break;
case TYPE_LONG:
value = ic.readLong("longVal", 0l);
break;
case TYPE_SAVABLE:
value = ic.readSavable("savableVal", null);
break;
case TYPE_LIST:
value = this.readList(ic, "0");
break;
case TYPE_MAP:
Map<Object, Object> map = new HashMap<Object, Object>();
List<?> keys = this.readList(ic, "0");
List<?> values = this.readList(ic, "1");
for (int i = 0; i < keys.size(); ++i) {
map.put(keys.get(i), values.get(i));
}
value = map;
break;
case TYPE_ARRAY:
value = this.readList(ic, "0").toArray();
break;
default:
throw new UnsupportedOperationException("Unknown type of stored data: " + type);
}
}