本文整理汇总了Java中libcore.util.EmptyArray.LONG属性的典型用法代码示例。如果您正苦于以下问题:Java EmptyArray.LONG属性的具体用法?Java EmptyArray.LONG怎么用?Java EmptyArray.LONG使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类libcore.util.EmptyArray
的用法示例。
在下文中一共展示了EmptyArray.LONG属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LongSparseLongArray
/**
* Creates a new SparseLongArray containing no mappings that will not
* require any additional memory allocation to store the specified
* number of mappings. If you supply an initial capacity of 0, the
* sparse array will be initialized with a light-weight representation
* not requiring any additional array allocations.
*/
public LongSparseLongArray(int initialCapacity) {
if (initialCapacity == 0) {
mKeys = EmptyArray.LONG;
mValues = EmptyArray.LONG;
} else {
mKeys = ArrayUtils.newUnpaddedLongArray(initialCapacity);
mValues = new long[mKeys.length];
}
mSize = 0;
}
示例2: LongSparseArray
/**
* Creates a new LongSparseArray containing no mappings that will not
* require any additional memory allocation to store the specified
* number of mappings. If you supply an initial capacity of 0, the
* sparse array will be initialized with a light-weight representation
* not requiring any additional array allocations.
*/
public LongSparseArray(int initialCapacity) {
if (initialCapacity == 0) {
mKeys = EmptyArray.LONG;
mValues = EmptyArray.OBJECT;
} else {
mKeys = ArrayUtils.newUnpaddedLongArray(initialCapacity);
mValues = ArrayUtils.newUnpaddedObjectArray(initialCapacity);
}
mSize = 0;
}
示例3: SparseLongArray
/**
* Creates a new SparseLongArray containing no mappings that will not
* require any additional memory allocation to store the specified
* number of mappings. If you supply an initial capacity of 0, the
* sparse array will be initialized with a light-weight representation
* not requiring any additional array allocations.
*/
public SparseLongArray(int initialCapacity) {
if (initialCapacity == 0) {
mKeys = EmptyArray.INT;
mValues = EmptyArray.LONG;
} else {
mValues = ArrayUtils.newUnpaddedLongArray(initialCapacity);
mKeys = new int[mValues.length];
}
mSize = 0;
}
示例4: LongArray
/**
* Creates an empty LongArray with the specified initial capacity.
*/
public LongArray(int initialCapacity) {
if (initialCapacity == 0) {
mValues = EmptyArray.LONG;
} else {
mValues = ArrayUtils.newUnpaddedLongArray(initialCapacity);
}
mSize = 0;
}