java.util.ArrayDeque.doubleCapacity()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(197)

本文整理了Java中java.util.ArrayDeque.doubleCapacity()方法的一些代码示例,展示了ArrayDeque.doubleCapacity()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ArrayDeque.doubleCapacity()方法的具体详情如下:
包路径:java.util.ArrayDeque
类名称:ArrayDeque
方法名:doubleCapacity

ArrayDeque.doubleCapacity介绍

[英]Double the capacity of this deque. Call only when full, i.e., when head and tail have wrapped around to become equal.
[中]使这台电视机的容量加倍。只有在满的时候才呼叫,也就是说,当头部和尾部缠绕成相等的时候。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: robovm/robovm

/**
 * Inserts the specified element at the end of this deque.
 *
 * <p>This method is equivalent to {@link #add}.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addLast(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[tail] = e;
  if ( (tail = (tail + 1) & (elements.length - 1)) == head)
    doubleCapacity();
}

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException();
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: MobiVM/robovm

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: ibinti/bugvm

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException();
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: com.jtransc/jtransc-rt

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: MobiVM/robovm

/**
 * Inserts the specified element at the end of this deque.
 *
 * <p>This method is equivalent to {@link #add}.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addLast(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[tail] = e;
  if ( (tail = (tail + 1) & (elements.length - 1)) == head)
    doubleCapacity();
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException();
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Inserts the specified element at the front of this deque.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addFirst(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[head = (head - 1) & (elements.length - 1)] = e;
  if (head == tail)
    doubleCapacity();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Inserts the specified element at the end of this deque.
 *
 * <p>This method is equivalent to {@link #add}.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addLast(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[tail] = e;
  if ( (tail = (tail + 1) & (elements.length - 1)) == head)
    doubleCapacity();
}

代码示例来源:origin: ibinti/bugvm

/**
 * Inserts the specified element at the end of this deque.
 *
 * <p>This method is equivalent to {@link #add}.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addLast(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[tail] = e;
  if ( (tail = (tail + 1) & (elements.length - 1)) == head)
    doubleCapacity();
}

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

/**
 * Inserts the specified element at the end of this deque.
 *
 * <p>This method is equivalent to {@link #add}.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addLast(E e) {
  if (e == null)
    throw new NullPointerException();
  elements[tail] = e;
  if ( (tail = (tail + 1) & (elements.length - 1)) == head)
    doubleCapacity();
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * Inserts the specified element at the end of this deque.
 *
 * <p>This method is equivalent to {@link #add}.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addLast(E e) {
  if (e == null)
    throw new NullPointerException();
  elements[tail] = e;
  if ( (tail = (tail + 1) & (elements.length - 1)) == head)
    doubleCapacity();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Inserts the specified element at the end of this deque.
 *
 * <p>This method is equivalent to {@link #add}.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addLast(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[tail] = e;
  if ( (tail = (tail + 1) & (elements.length - 1)) == head)
    doubleCapacity();
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Inserts the specified element at the end of this deque.
 *
 * <p>This method is equivalent to {@link #add}.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addLast(E e) {
  if (e == null)
    throw new NullPointerException("e == null");
  elements[tail] = e;
  if ( (tail = (tail + 1) & (elements.length - 1)) == head)
    doubleCapacity();
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * Inserts the specified element at the end of this deque.
 *
 * <p>This method is equivalent to {@link #add}.
 *
 * @param e the element to add
 * @throws NullPointerException if the specified element is null
 */
public void addLast(E e) {
  if (e == null)
    throw new NullPointerException();
  elements[tail] = e;
  if ( (tail = (tail + 1) & (elements.length - 1)) == head)
    doubleCapacity();
}

相关文章

微信公众号

最新文章

更多