本文整理汇总了Java中com.google.common.primitives.Shorts.toArray方法的典型用法代码示例。如果您正苦于以下问题:Java Shorts.toArray方法的具体用法?Java Shorts.toArray怎么用?Java Shorts.toArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.primitives.Shorts
的用法示例。
在下文中一共展示了Shorts.toArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toArray
import com.google.common.primitives.Shorts; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"}) // NOTE: We assume the component type matches the list
private Object toArray(Class<?> componentType, List<Object> values) {
if (componentType == boolean.class) {
return Booleans.toArray((Collection) values);
} else if (componentType == byte.class) {
return Bytes.toArray((Collection) values);
} else if (componentType == short.class) {
return Shorts.toArray((Collection) values);
} else if (componentType == int.class) {
return Ints.toArray((Collection) values);
} else if (componentType == long.class) {
return Longs.toArray((Collection) values);
} else if (componentType == float.class) {
return Floats.toArray((Collection) values);
} else if (componentType == double.class) {
return Doubles.toArray((Collection) values);
} else if (componentType == char.class) {
return Chars.toArray((Collection) values);
}
return values.toArray((Object[]) Array.newInstance(componentType, values.size()));
}
示例2: build
import com.google.common.primitives.Shorts; //导入方法依赖的package包/类
public PredicateIndex build() {
return new PredicateIndex(
config,
Ints.toArray(seenIds),
Bytes.toArray(minFeatureIndexBuilder),
Shorts.toArray(intervalEndsBuilder),
highestIntervalEnd,
intervalIndexBuilder.build(),
boundsIndexBuilder.build(),
conjunctionIntervalIndexBuilder.build(),
intervalStoreBuilder.build(),
conjunctionIndexBuilder.build(),
Ints.toArray(zeroConstraintDocuments)
);
}
示例3: deserialize
import com.google.common.primitives.Shorts; //导入方法依赖的package包/类
@Override public short[] deserialize(TypeToken<?> type, ConfigurationNode value) throws ObjectMappingException {
List<Short> list = value.getList(ttb);
return Shorts.toArray(list);
}
示例4: getValue
import com.google.common.primitives.Shorts; //导入方法依赖的package包/类
public Object getValue(Property prop) {
return Shorts.toArray(Ints.asList(prop.getIntList()));
}
示例5: setColumns
import com.google.common.primitives.Shorts; //导入方法依赖的package包/类
Builder setColumns(List<Short> columns) {
this.columns = Shorts.toArray(columns);
return this;
}
示例6: Column
import com.google.common.primitives.Shorts; //导入方法依赖的package包/类
public Column(TColumn colValues) {
if (colValues.isSetBoolVal()) {
type = Type.BOOLEAN_TYPE;
nulls = toBitset(colValues.getBoolVal().getNulls());
boolVars = Booleans.toArray(colValues.getBoolVal().getValues());
size = boolVars.length;
} else if (colValues.isSetByteVal()) {
type = Type.TINYINT_TYPE;
nulls = toBitset(colValues.getByteVal().getNulls());
byteVars = Bytes.toArray(colValues.getByteVal().getValues());
size = byteVars.length;
} else if (colValues.isSetI16Val()) {
type = Type.SMALLINT_TYPE;
nulls = toBitset(colValues.getI16Val().getNulls());
shortVars = Shorts.toArray(colValues.getI16Val().getValues());
size = shortVars.length;
} else if (colValues.isSetI32Val()) {
type = Type.INT_TYPE;
nulls = toBitset(colValues.getI32Val().getNulls());
intVars = Ints.toArray(colValues.getI32Val().getValues());
size = intVars.length;
} else if (colValues.isSetI64Val()) {
type = Type.BIGINT_TYPE;
nulls = toBitset(colValues.getI64Val().getNulls());
longVars = Longs.toArray(colValues.getI64Val().getValues());
size = longVars.length;
} else if (colValues.isSetDoubleVal()) {
type = Type.DOUBLE_TYPE;
nulls = toBitset(colValues.getDoubleVal().getNulls());
doubleVars = Doubles.toArray(colValues.getDoubleVal().getValues());
size = doubleVars.length;
} else if (colValues.isSetBinaryVal()) {
type = Type.BINARY_TYPE;
nulls = toBitset(colValues.getBinaryVal().getNulls());
binaryVars = colValues.getBinaryVal().getValues();
size = binaryVars.size();
} else if (colValues.isSetStringVal()) {
type = Type.STRING_TYPE;
nulls = toBitset(colValues.getStringVal().getNulls());
stringVars = colValues.getStringVal().getValues();
size = stringVars.size();
} else {
throw new IllegalStateException("invalid union object");
}
}