public Object getResult() { return resultStack.pollLast(); }
/** * Removes and returns last element, or null if empty. * * @return The removed element. */ private E innerRemoveLast() { E l = list.pollLast(); if (l == null) return null; notFull.signal(); return l; }
public JobPo pollLast() { lock.lock(); try { JobPo l = list.pollLast(); if (l == null) return null; jobs.remove(l.getJobId()); return l; } finally { lock.unlock(); } }
public JobPo pollLast() { lock.lock(); try { JobPo l = list.pollLast(); if (l == null) return null; jobs.remove(l.getJobId()); return l; } finally { lock.unlock(); } }
/** Tallies a value in the histogram. */ public void add(T value) { int i = segmenter.segment(value); counts[i]++; totalCount++; if (this.recentAdditions.size() > Histogram.MAX_HISTORY_SIZE) { this.recentAdditions.pollLast(); } this.recentAdditions.push(value); }
/** * Retain the capacity to the given number; The extra counters will be cut off * @param newCapacity */ public void retain(int newCapacity) { this.capacity = newCapacity; if (this.size() > newCapacity) { Counter<T> toRemoved; for (int i = 0, n = this.size() - newCapacity; i < n; i++) { toRemoved = counterList.pollLast(); this.counterMap.remove(toRemoved.item); } } }
while ((req = queue.pollLast()) != null) { e.getRequests.addFirst(req);
indentStack.poll(); tok = this.stash.pollLast();
public ElementType popFront(int slotNumber) { if (0 <= slotNumber && slotNumber < slotTypes.length) { return slotLists[slotNumber].pollLast(); } else { return null; } }
private Query(QueryBuilder<T> builder) { this.type = builder.type; this.comparator = builder.comparator; if (builder.predicates.size() == 1) { this.predicate = Optional.of(builder.predicates.pollLast()); } else { this.predicate = Optional.empty(); } this.skip = builder.skip; this.limit = builder.limit; }
/** * スタックの値を取り出し、文字列として結合する。 * @param stack * @return */ public static String popupAndConcat(final LinkedList<String> stack) { StringBuilder value = new StringBuilder(); while(!stack.isEmpty()) { value.append(stack.pollLast()); } return value.toString(); }
/** Tallies a value in the histogram. */ public void add(T value) { int i = segmenter.segment(value); counts[i]++; totalCount++; if (this.recentAdditions.size() > Histogram.MAX_HISTORY_SIZE) { this.recentAdditions.pollLast(); } this.recentAdditions.push(value); }
/** Tallies a value in the histogram. */ public void add(T value) { int i = segmenter.segment(value); counts[i]++; totalCount++; if (this.recentAdditions.size() > Histogram.MAX_HISTORY_SIZE) { this.recentAdditions.pollLast(); } this.recentAdditions.push(value); }
private void removeLastPackageAndModuleIfNecessary() { packageStack.pollLast(); final boolean moveAboveModuleLevel = currentModule != null && currentModule.getName().size() > packageStack.size() -1; //first package is the empty package if (moveAboveModuleLevel) { currentModule = null; } }
/** * Redo the last action, if possible */ public void redo() { if (!redoDeltas.isEmpty()) { MapDataDelta delta = redoDeltas.pollLast(); MapDataDelta inverse = data.apply(delta); undoDeltas.addLast(inverse); } updateMenuAndToolbar(); changedSinceLastSave = true; }
/** * Undo the last action, if possible */ public void undo() { if (!undoDeltas.isEmpty()) { MapDataDelta delta = undoDeltas.pollLast(); MapDataDelta inverse = data.apply(delta); redoDeltas.addLast(inverse); } updateMenuAndToolbar(); changedSinceLastSave = true; }
private SimpleMergeRSIDTest(String... arg) { super(SimpleMergeRSIDTest.class); LinkedList<String> allStrings = new LinkedList<String>(Arrays.asList(arg)); expected = allStrings.pollLast(); inputs = allStrings; }
private MergeAllelesTest(List<Allele>... arg) { super(MergeAllelesTest.class); LinkedList<List<Allele>> all = new LinkedList<>(Arrays.asList(arg)); expected = all.pollLast(); inputs = all; }
@Override public Object pollLast() { if (!_directAccess && isDelayLoad()) { load(); } return super.pollLast(); }
private MergeGenotypesTest(String name, String priority, VariantContext... arg) { super(MergeGenotypesTest.class, name); LinkedList<VariantContext> all = new LinkedList<VariantContext>(Arrays.asList(arg)); this.expected = all.pollLast(); inputs = all; this.priority = Arrays.asList(priority.split(",")); }