本文整理汇总了Java中java.lang.Short类的典型用法代码示例。如果您正苦于以下问题:Java Short类的具体用法?Java Short怎么用?Java Short使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Short类属于java.lang包,在下文中一共展示了Short类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getElementNode
import java.lang.Short; //导入依赖的package包/类
private Node getElementNode(Node node) {
Short nodeType = Short.valueOf(node.getNodeType());
while (!ELEMENT_NODE.equals(nodeType)) {
if (ELEMENT_NODE.equals(nodeType)) {
return node;
}
node = node.getNextSibling();
if (node == null) {
return null;
}
nodeType = Short.valueOf(node.getNodeType());
}
return node;
}
示例2: toPrimitive
import java.lang.Short; //导入依赖的package包/类
public static short[] toPrimitive(Short[] shortParam) {
short[] shorts = new short[shortParam.length];
for (int i = 0; i < shortParam.length; i++) {
shorts[i] = shortParam[i];
}
return shorts;
}
示例3: unbundle
import java.lang.Short; //导入依赖的package包/类
public static TestClassBundledGCM unbundle(Bundle bundle, Gson gson) {
return new AutoValue_TestClassBundledGCM(
bundle,
Byte.parseByte(bundle.getString("some_byte")),
Boolean.parseBoolean(bundle.getString("some_boolean")),
Short.parseShort(bundle.getString("some_short")),
Integer.parseInt(bundle.getString("some_int")),
Long.parseLong(bundle.getString("some_long")),
bundle.getString("some_char").charAt(0),
Float.parseFloat(bundle.getString("some_float")),
Double.parseDouble(bundle.getString("some_double")),
bundle.getString("some_string"),
bundle.getString("some_char_sequence"),
gson.fromJson(bundle.getString("some_parcelable"), Parcelable.class),
gson.fromJson(bundle.getString("some_parcelable_array_list"), new com.google.common.reflect.TypeToken<java.util.ArrayList<Parcelable>>(){}.getType()),
gson.fromJson(bundle.getString("some_parcelable_sparse_array"), new com.google.common.reflect.TypeToken<android.util.SparseArray<Parcelable>>(){}.getType()),
gson.fromJson(bundle.getString("some_serializable"), Serializable.class),
gson.fromJson(bundle.getString("some_integer_array_list"), new com.google.common.reflect.TypeToken<java.util.ArrayList<Integer>>(){}.getType()),
gson.fromJson(bundle.getString("some_string_array_list"), new com.google.common.reflect.TypeToken<java.util.ArrayList<String>>(){}.getType()),
gson.fromJson(bundle.getString("some_char_sequence_array_list"), new com.google.common.reflect.TypeToken<java.util.ArrayList<CharSequence>>(){}.getType()),
toPrimitive(gson.fromJson(bundle.getString("some_byte_array"), Byte[].class)),
toPrimitive(gson.fromJson(bundle.getString("some_short_array"), Short[].class)),
toPrimitive(gson.fromJson(bundle.getString("some_char_array"), Character[].class)),
toPrimitive(gson.fromJson(bundle.getString("some_float_array"), Float[].class)),
gson.fromJson(bundle.getString("some_unknown_object"), new com.google.common.reflect.TypeToken<UnknownObject>(){}.getType()),
gson.fromJson(bundle.getString("some_unknown_object_list"), new com.google.common.reflect.TypeToken<ArrayList<UnknownObject>>(){}.getType()),
gson.fromJson(bundle.getString("test_enum"), new com.google.common.reflect.TypeToken<TestEnum>(){}.getType()));
}
示例4: PrimitiveWrappersActivityScreen
import java.lang.Short; //导入依赖的package包/类
public PrimitiveWrappersActivityScreen(Character field1, Integer field2, Double field3, Float field4, Boolean field5,
Short field6, Byte field7, Long field8) {
this.field1 = field1;
this.field2 = field2;
this.field3 = field3;
this.field4 = field4;
this.field5 = field5;
this.field6 = field6;
this.field7 = field7;
this.field8 = field8;
}
示例5: createJsonAsString
import java.lang.Short; //导入依赖的package包/类
public static String createJsonAsString(ContentValues cv)
{
Set<Map.Entry<String, Object>> data = cv.valueSet();
Iterator<Map.Entry<String, Object>> iter = data.iterator();
final JSONObject json = new JSONObject();
while (iter.hasNext())
{
Map.Entry<String, Object> entry = (Map.Entry<String, Object>)iter.next();
try {
if (entry.getValue() instanceof String) {
json.put(entry.getKey(), cv.getAsString(entry.getKey()));
} else if (entry.getValue() instanceof Integer) {
json.put(entry.getKey(), cv.getAsInteger(entry.getKey()));
} else if (entry.getValue() instanceof Long) {
json.put(entry.getKey(), cv.getAsLong(entry.getKey()));
} else if (entry.getValue() instanceof Short) {
json.put(entry.getKey(), cv.getAsShort(entry.getKey()));
} else if (entry.getValue() instanceof Double) {
json.put(entry.getKey(), cv.getAsDouble(entry.getKey()));
} else if (entry.getValue() instanceof Boolean) {
json.put(entry.getKey(), cv.getAsBoolean(entry.getKey()));
}
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}
Log.d(TAG, "generated JSON = [" + json.toString() + "]");
return json.toString();
}
示例6: mapFromCursor
import java.lang.Short; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NonNull
public BoxedTypesMethodsFactoryMethod mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {
Boolean field1 = null;
if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
}
Short field2 = null;
if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
field2 = cursor.getShort(cursor.getColumnIndex("field2"));
}
Integer field3 = null;
if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
field3 = cursor.getInt(cursor.getColumnIndex("field3"));
}
Long field4 = null;
if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
field4 = cursor.getLong(cursor.getColumnIndex("field4"));
}
Float field5 = null;
if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
}
Double field6 = null;
if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
}
BoxedTypesMethodsFactoryMethod object = BoxedTypesMethodsFactoryMethod.create(field1, field2, field3, field4, field5, field6);
return object;
}
开发者ID:pushtorefresh,项目名称:storio,代码行数:37,代码来源:BoxedTypesMethodsFactoryMethodStorIOSQLiteGetResolver.java
示例7: mapFromCursor
import java.lang.Short; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NonNull
public BoxedTypesPrivateFields mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {
Boolean field1 = null;
if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
}
Short field2 = null;
if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
field2 = cursor.getShort(cursor.getColumnIndex("field2"));
}
Integer field3 = null;
if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
field3 = cursor.getInt(cursor.getColumnIndex("field3"));
}
Long field4 = null;
if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
field4 = cursor.getLong(cursor.getColumnIndex("field4"));
}
Float field5 = null;
if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
}
Double field6 = null;
if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
}
BoxedTypesPrivateFields object = new BoxedTypesPrivateFields(field1, field2, field3, field4, field5, field6);
return object;
}
示例8: mapFromCursor
import java.lang.Short; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NonNull
public BoxedTypesMethodsConstructor mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {
Boolean field1 = null;
if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
}
Short field2 = null;
if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
field2 = cursor.getShort(cursor.getColumnIndex("field2"));
}
Integer field3 = null;
if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
field3 = cursor.getInt(cursor.getColumnIndex("field3"));
}
Long field4 = null;
if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
field4 = cursor.getLong(cursor.getColumnIndex("field4"));
}
Float field5 = null;
if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
}
Double field6 = null;
if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
}
BoxedTypesMethodsConstructor object = new BoxedTypesMethodsConstructor(field1, field2, field3, field4, field5, field6);
return object;
}
开发者ID:pushtorefresh,项目名称:storio,代码行数:37,代码来源:BoxedTypesMethodsConstructorStorIOSQLiteGetResolver.java
示例9: mapFromCursor
import java.lang.Short; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NonNull
public BoxedTypesPrivateFieldsIgnoreNull mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {
Boolean field1 = null;
if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
}
Short field2 = null;
if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
field2 = cursor.getShort(cursor.getColumnIndex("field2"));
}
Integer field3 = null;
if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
field3 = cursor.getInt(cursor.getColumnIndex("field3"));
}
Long field4 = null;
if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
field4 = cursor.getLong(cursor.getColumnIndex("field4"));
}
Float field5 = null;
if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
}
Double field6 = null;
if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
}
BoxedTypesPrivateFieldsIgnoreNull object = new BoxedTypesPrivateFieldsIgnoreNull(field1, field2, field3, field4, field5, field6);
return object;
}
开发者ID:pushtorefresh,项目名称:storio,代码行数:37,代码来源:BoxedTypesPrivateFieldsIgnoreNullStorIOSQLiteGetResolver.java
示例10: mapFromCursor
import java.lang.Short; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NonNull
public BoxedTypesMethodsConstructorIgnoreNull mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {
Boolean field1 = null;
if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
}
Short field2 = null;
if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
field2 = cursor.getShort(cursor.getColumnIndex("field2"));
}
Integer field3 = null;
if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
field3 = cursor.getInt(cursor.getColumnIndex("field3"));
}
Long field4 = null;
if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
field4 = cursor.getLong(cursor.getColumnIndex("field4"));
}
Float field5 = null;
if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
}
Double field6 = null;
if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
}
BoxedTypesMethodsConstructorIgnoreNull object = new BoxedTypesMethodsConstructorIgnoreNull(field1, field2, field3, field4, field5, field6);
return object;
}
开发者ID:pushtorefresh,项目名称:storio,代码行数:37,代码来源:BoxedTypesMethodsConstructorIgnoreNullStorIOSQLiteGetResolver.java
示例11: mapFromCursor
import java.lang.Short; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NonNull
public BoxedTypesMethodsFactoryMethodIgnoreNull mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {
Boolean field1 = null;
if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
}
Short field2 = null;
if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
field2 = cursor.getShort(cursor.getColumnIndex("field2"));
}
Integer field3 = null;
if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
field3 = cursor.getInt(cursor.getColumnIndex("field3"));
}
Long field4 = null;
if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
field4 = cursor.getLong(cursor.getColumnIndex("field4"));
}
Float field5 = null;
if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
}
Double field6 = null;
if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
}
BoxedTypesMethodsFactoryMethodIgnoreNull object = BoxedTypesMethodsFactoryMethodIgnoreNull.create(field1, field2, field3, field4, field5, field6);
return object;
}
开发者ID:pushtorefresh,项目名称:storio,代码行数:37,代码来源:BoxedTypesMethodsFactoryMethodIgnoreNullStorIOSQLiteGetResolver.java
示例12: mapFromCursor
import java.lang.Short; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NonNull
public BoxedTypesMethodsFactoryMethod mapFromCursor(@NonNull StorIOContentResolver storIOContentResolver, @NonNull Cursor cursor) {
Boolean field1 = null;
if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
}
Short field2 = null;
if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
field2 = cursor.getShort(cursor.getColumnIndex("field2"));
}
Integer field3 = null;
if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
field3 = cursor.getInt(cursor.getColumnIndex("field3"));
}
Long field4 = null;
if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
field4 = cursor.getLong(cursor.getColumnIndex("field4"));
}
Float field5 = null;
if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
}
Double field6 = null;
if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
}
BoxedTypesMethodsFactoryMethod object = BoxedTypesMethodsFactoryMethod.create(field1, field2, field3, field4, field5, field6);
return object;
}
开发者ID:pushtorefresh,项目名称:storio,代码行数:37,代码来源:BoxedTypesMethodsFactoryMethodStorIOContentResolverGetResolver.java
示例13: mapFromCursor
import java.lang.Short; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NonNull
public BoxedTypesMethodsConstructor mapFromCursor(@NonNull StorIOContentResolver storIOContentResolver, @NonNull Cursor cursor) {
Boolean field1 = null;
if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
}
Short field2 = null;
if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
field2 = cursor.getShort(cursor.getColumnIndex("field2"));
}
Integer field3 = null;
if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
field3 = cursor.getInt(cursor.getColumnIndex("field3"));
}
Long field4 = null;
if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
field4 = cursor.getLong(cursor.getColumnIndex("field4"));
}
Float field5 = null;
if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
}
Double field6 = null;
if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
}
BoxedTypesMethodsConstructor object = new BoxedTypesMethodsConstructor(field1, field2, field3, field4, field5, field6);
return object;
}
开发者ID:pushtorefresh,项目名称:storio,代码行数:37,代码来源:BoxedTypesMethodsConstructorStorIOContentResolverGetResolver.java
示例14: mapFromCursor
import java.lang.Short; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NonNull
public BoxedTypesMethodsConstructorIgnoreNull mapFromCursor(@NonNull StorIOContentResolver storIOContentResolver, @NonNull Cursor cursor) {
Boolean field1 = null;
if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
}
Short field2 = null;
if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
field2 = cursor.getShort(cursor.getColumnIndex("field2"));
}
Integer field3 = null;
if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
field3 = cursor.getInt(cursor.getColumnIndex("field3"));
}
Long field4 = null;
if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
field4 = cursor.getLong(cursor.getColumnIndex("field4"));
}
Float field5 = null;
if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
}
Double field6 = null;
if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
}
BoxedTypesMethodsConstructorIgnoreNull object = new BoxedTypesMethodsConstructorIgnoreNull(field1, field2, field3, field4, field5, field6);
return object;
}
开发者ID:pushtorefresh,项目名称:storio,代码行数:37,代码来源:BoxedTypesMethodsConstructorIgnoreNullStorIOContentResolverGetResolver.java
示例15: mapFromCursor
import java.lang.Short; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NonNull
public BoxedTypesPrivateFields mapFromCursor(@NonNull StorIOContentResolver storIOContentResolver, @NonNull Cursor cursor) {
Boolean field1 = null;
if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
}
Short field2 = null;
if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
field2 = cursor.getShort(cursor.getColumnIndex("field2"));
}
Integer field3 = null;
if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
field3 = cursor.getInt(cursor.getColumnIndex("field3"));
}
Long field4 = null;
if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
field4 = cursor.getLong(cursor.getColumnIndex("field4"));
}
Float field5 = null;
if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
}
Double field6 = null;
if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
}
BoxedTypesPrivateFields object = new BoxedTypesPrivateFields(field1, field2, field3, field4, field5, field6);
return object;
}
开发者ID:pushtorefresh,项目名称:storio,代码行数:37,代码来源:BoxedTypesPrivateFieldsStorIOContentResolverGetResolver.java