Java Code Examples for com.google.common.primitives.Longs.asList()

The following are Jave code examples for showing how to use asList() of the com.google.common.primitives.Longs class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: jpmml-tensorflow   File: TensorUtil.java   View Source Code Vote up 6 votes
static
public List<?> getValues(Tensor tensor){
	DataType dataType = tensor.dataType();

	switch(dataType){
		case FLOAT:
			return Floats.asList(TensorUtil.toFloatArray(tensor));
		case DOUBLE:
			return Doubles.asList(TensorUtil.toDoubleArray(tensor));
		case INT32:
			return Ints.asList(TensorUtil.toIntArray(tensor));
		case INT64:
			return Longs.asList(TensorUtil.toLongArray(tensor));
		case STRING:
			return Arrays.asList(TensorUtil.toStringArray(tensor));
		case BOOL:
			return Booleans.asList(TensorUtil.toBooleanArray(tensor));
		default:
			throw new IllegalArgumentException();
	}
}
 
Example 2
Project: GitHub   File: Intrinsics.java   View Source Code Vote up 4 votes
public static Iterable<Long> $in(long[] elements) {
  return Longs.asList(elements);
}
 
Example 3
Project: util   File: ArrayUtil.java   View Source Code Vote up 2 votes
/**
 * Arrays.asList()的加强版, 返回一个底层为原始类型long的List
 * 
 * 与保存Long相比节约空间,同时只在读取数据时AutoBoxing.
 * 
 * @see java.util.Arrays#asList(Object...)
 * @see com.google.common.primitives.Longs#asList(long...)
 */
public static List<Long> longAsList(long... backingArray) {
	return Longs.asList(backingArray);
}