本文整理汇总了Java中com.intellij.util.ArrayUtil.realloc方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.realloc方法的具体用法?Java ArrayUtil.realloc怎么用?Java ArrayUtil.realloc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil.realloc方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IElementType
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
protected IElementType(@NotNull @NonNls String debugName, @Nullable Language language, boolean register) {
myDebugName = debugName;
myLanguage = language == null ? Language.ANY : language;
if (register) {
synchronized (lock) {
myIndex = size++;
LOG.assertTrue(myIndex < MAX_INDEXED_TYPES, "Too many element types registered. Out of (short) range.");
IElementType[] newRegistry =
myIndex >= ourRegistry.length ? ArrayUtil.realloc(ourRegistry, ourRegistry.length * 3 / 2 + 1, FACTORY) : ourRegistry;
newRegistry[myIndex] = this;
ourRegistry = newRegistry;
}
}
else {
myIndex = -1;
}
}
示例2: getBlock
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@Override
public byte[] getBlock(final int start, final int length) throws IOException {
myStream.seek(start);
final byte[] bytes = new byte[length];
final int read = myStream.read(bytes);
return ArrayUtil.realloc(bytes, read);
}
示例3: push
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
public void push(boolean t) {
if (size >= data.length) {
data = ArrayUtil.realloc(data, data.length * 3 / 2);
}
data[size++] = t;
}
示例4: push
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
public void push(long t) {
if (size >= data.length) {
data = ArrayUtil.realloc(data, data.length * 3 / 2);
}
data[size++] = t;
}
示例5: push
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
public void push(int t) {
if (size >= data.length) {
data = ArrayUtil.realloc(data, data.length * 3 / 2);
}
data[size++] = t;
}
示例6: ensureCapacity
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private void ensureCapacity() {
if (storage.length <= index) {
int newCapacity = Math.min(capacity, storage.length * 3 / 2);
storage = ArrayUtil.realloc(storage, newCapacity, ArrayUtil.OBJECT_ARRAY_FACTORY);
}
}
示例7: trimToSize
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
public void trimToSize() {
if (mySize < myData.length){
myData = ArrayUtil.realloc(myData, mySize);
}
}