Tabnine Logo
Collections.asLifoQueue
Code IndexAdd Tabnine to your IDE (free)

How to use
asLifoQueue
method
in
java.util.Collections

Best Java code snippets using java.util.Collections.asLifoQueue (Showing top 20 results out of 315)

origin: springside/springside4

/**
 * 支持后进先出的栈,用ArrayDeque实现, 经过Collections#asLifoQueue()转换顺序
 * 
 * 需设置初始长度,默认为16,数组满时成倍扩容
 * 
 * @see Collections#asLifoQueue()
 */
public static <E> Queue<E> createStack(int initSize) {
  return Collections.asLifoQueue(new ArrayDeque<E>(initSize));
}
origin: vipshop/vjtools

/**
 * 支持后进先出的栈,用ArrayDeque实现, 经过Collections#asLifoQueue()转换顺序
 * 
 * 需设置初始长度,默认为16,数组满时成倍扩容
 * 
 * @see Collections#asLifoQueue()
 */
public static <E> Queue<E> createStack(int initSize) {
  return Collections.asLifoQueue(new ArrayDeque<E>(initSize));
}
origin: pmd/pmd

  @Override
  protected Queue<TimerEntry> initialValue() {
    return Collections.asLifoQueue(new LinkedList<TimerEntry>());
  }
};
origin: springside/springside4

/**
 * 支持后进先出的无阻塞的并发栈,用ConcurrentLinkedDeque实现,经过Collections#asLifoQueue()转换顺序
 * 
 * 另对于BlockingQueue接口, JDK暂无Lifo倒转实现,因此只能直接使用未调转顺序的LinkedBlockingDeque
 * 
 * @see Collections#asLifoQueue()
 */
public static <E> Queue<E> createConcurrentStack() {
  return (Queue<E>) Collections.asLifoQueue(QueueUtil.newConcurrentNonBlockingDeque());
}
origin: vipshop/vjtools

/**
 * 支持后进先出的无阻塞的并发栈,用ConcurrentLinkedDeque实现,经过Collections#asLifoQueue()转换顺序
 * 
 * 另对于BlockingQueue接口, JDK暂无Lifo倒转实现,因此只能直接使用未调转顺序的LinkedBlockingDeque
 * 
 * @see Collections#asLifoQueue()
 */
public static <E> Queue<E> createConcurrentStack() {
  return (Queue<E>) Collections.asLifoQueue(QueueUtil.newConcurrentNonBlockingDeque());
}
origin: xuminwlt/j360-dubbo-app-all

/**
 * 支持后进先出的栈,用ArrayDeque实现, 经过Collections#asLifoQueue()转换顺序
 * 
 * 需设置初始长度,默认为16,数组满时成倍扩容
 * 
 * @see Collections#asLifoQueue()
 */
public static <E> Queue<E> createStack(int initSize) {
  return Collections.asLifoQueue(new ArrayDeque<E>(initSize));
}
origin: io.springside/springside-utils

/**
 * 支持后进先出的栈,用ArrayDeque实现, 经过Collections#asLifoQueue()转换顺序
 * 
 * 需设置初始长度,默认为16,数组满时成倍扩容
 * 
 * @see Collections#asLifoQueue()
 */
public static <E> Queue<E> createStack(int initSize) {
  return Collections.asLifoQueue(new ArrayDeque<E>(initSize));
}
origin: de.learnlib/learnlib-datastructure-pta

  @Override
  public <S extends AbstractBlueFringePTAState<?, ?, S>> Queue<PTATransition<S>> createWorklist() {
    return Collections.asLifoQueue(new ArrayDeque<>());
  }
}
origin: DarLiner/vjtools

/**
 * 支持后进先出的栈,用ArrayDeque实现, 经过Collections#asLifoQueue()转换顺序
 * 
 * 需设置初始长度,默认为16,数组满时成倍扩容
 * 
 * @see Collections#asLifoQueue()
 */
public static <E> Queue<E> createStack(int initSize) {
  return Collections.asLifoQueue(new ArrayDeque<E>(initSize));
}
origin: net.sourceforge.pmd/pmd-core

  @Override
  protected Queue<TimerEntry> initialValue() {
    return Collections.asLifoQueue(new LinkedList<TimerEntry>());
  }
};
origin: mwilliamson/java-mammoth

  public static <T> Queue<T> stack() {
    return Collections.asLifoQueue(new ArrayDeque<>());
  }
}
origin: stackoverflow.com

 Queue<Integer> arrayLifoQueue = Collections.asLifoQueue(new ArrayDeque<Integer>());
Queue<Integer> linkedListLifoQueue = Collections.asLifoQueue(new LinkedList<Integer>());
origin: stackoverflow.com

 Queue<Object> stack = Collections.asLifoQueue(new ArrayDeque<Object>());
stack.add("red");
stack.add(Color.GREEN);
stack.add(stack);
origin: DarLiner/vjtools

/**
 * 支持后进先出的无阻塞的并发栈,用ConcurrentLinkedDeque实现,经过Collections#asLifoQueue()转换顺序
 * 
 * 另对于BlockingQueue接口, JDK暂无Lifo倒转实现,因此只能直接使用未调转顺序的LinkedBlockingDeque
 * 
 * @see Collections#asLifoQueue()
 */
public static <E> Queue<E> createConcurrentStack() {
  return (Queue<E>) Collections.asLifoQueue(QueueUtil.newConcurrentNonBlockingDeque());
}
origin: xuminwlt/j360-dubbo-app-all

/**
 * 支持后进先出的并发栈,用ConcurrentLinkedDeque实现,经过Collections#asLifoQueue()转换顺序
 * 
 * 另对于BlockingQueue接口, JDK暂无Lifo倒转实现,因此只能直接使用未调转顺序的LinkedBlockingDeque
 * 
 * @see Collections#asLifoQueue()
 */
public static <E> Queue<E> createConcurrentStack() {
  return (Queue<E>) Collections.asLifoQueue(newConcurrentNonBlockingDeque());
}
origin: io.springside/springside-utils

/**
 * 支持后进先出的并发栈,用ConcurrentLinkedDeque实现,经过Collections#asLifoQueue()转换顺序
 * 
 * 另对于BlockingQueue接口, JDK暂无Lifo倒转实现,因此只能直接使用未调转顺序的LinkedBlockingDeque
 * 
 * @see Collections#asLifoQueue()
 */
public static <E> Queue<E> createConcurrentStack() {
  return (Queue<E>) Collections.asLifoQueue(newConcurrentNonBlockingDeque());
}
origin: matsim-org/matsim

private Queue<AnswerNode> getInitialNodes(List<PlanRecord> plans ) {
  final Queue<AnswerNode> queue = Collections.asLifoQueue( new ArrayDeque<AnswerNode>() );
  for ( PlanRecord p : plans ) queue.add( new AnswerNode( p , null ) );
  return queue;
}
origin: apache/james-project

/**
 * @param stage the annotation that specifies this stage
 * @param mode  execution order
 */
public DefaultStager(Class<A> stage, Order mode) {
  this.stage = stage;
  Queue<Stageable> localStageables;
  switch (mode) {
    case FIRST_IN_FIRST_OUT: {
      localStageables = new ArrayDeque<>();
      break;
    }
    case FIRST_IN_LAST_OUT: {
      localStageables = Collections.asLifoQueue(new ArrayDeque<Stageable>());
      break;
    }
    default: {
      throw new IllegalArgumentException("Unknown mode: " + mode);
    }
  }
  stageables = localStageables;
}
origin: fbacchella/LogHub

/**
 * Finish the cloning of the copy
 * Ensure than transient fields store the good values
 * @return
 */
private Object readResolve() {
  if (!test) {
    timer = Properties.metrics.timer("Allevents.timer").time();
    Properties.metrics.counter("Allevents.inflight").inc();
  } else {
    timer = null;
  }
  processors = new LinkedList<>();
  wevent = null;
  timersStack = Collections.asLifoQueue(new ArrayDeque<PausingContext>());
  pipelineNames = new ArrayDeque<>();
  return this;
}
origin: stackoverflow.com

 public class Practice15 {

public static void main(String[] args) {


  Deque<Integer> dd=new ArrayDeque<Integer>();

  dd.offerFirst(123);

  dd.offerFirst(258);

  dd.offerFirst(125);

  System.out.println(dd);

  Queue<Integer> q1=Collections.asLifoQueue(dd);

  System.out.println(q1);

}
java.utilCollectionsasLifoQueue

Javadoc

Returns a last-in, first-out queue as a view of deque.

Popular methods of Collections

  • emptyList
    Returns the empty list (immutable). This list is serializable.This example illustrates the type-safe
  • sort
  • singletonList
    Returns an immutable list containing only the specified object. The returned list is serializable.
  • unmodifiableList
    Returns an unmodifiable view of the specified list. This method allows modules to provide users with
  • emptyMap
    Returns the empty map (immutable). This map is serializable.This example illustrates the type-safe w
  • emptySet
    Returns the empty set (immutable). This set is serializable. Unlike the like-named field, this metho
  • unmodifiableMap
    Returns an unmodifiable view of the specified map. This method allows modules to provide users with
  • singleton
    Returns an immutable set containing only the specified object. The returned set is serializable.
  • unmodifiableSet
    Returns an unmodifiable view of the specified set. This method allows modules to provide users with
  • singletonMap
    Returns an immutable map, mapping only the specified key to the specified value. The returned map is
  • addAll
    Adds all of the specified elements to the specified collection. Elements to be added may be specifie
  • reverse
    Reverses the order of the elements in the specified list. This method runs in linear time.
  • addAll,
  • reverse,
  • unmodifiableCollection,
  • shuffle,
  • enumeration,
  • list,
  • synchronizedMap,
  • synchronizedList,
  • reverseOrder,
  • emptyIterator

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now