本文整理匯總了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);
}
}