/** * 获取某一行的逆序迭代器 * * @param line 行号 * @return 逆序迭代器 */ public Iterator<Vertex> descendingIterator(int line) { return vertexes[line].descendingIterator(); }
public Iterator<E> descendingIterator() { return list.descendingIterator(); } }
@Override public Iterator<Counter<T>> iterator() { if (this.descending == true) { return this.counterList.descendingIterator(); } else { throw new IllegalStateException(); // support in future } }
public SubscriptionBaseTransitionDataIterator(final Clock clock, final LinkedList<SubscriptionBaseTransition> transitions, final Order order, final Visibility visibility, final TimeLimit timeLimit) { this.it = (order == Order.DESC_FROM_FUTURE) ? transitions.descendingIterator() : transitions.iterator(); this.clock = clock; this.timeLimit = timeLimit; this.visibility = visibility; this.next = null; }
public PassportItem findStateBackwards(PassportState state) { Iterator itr = history.descendingIterator(); while (itr.hasNext()) { PassportItem item = (PassportItem) itr.next(); if (item.getState() == state) { return item; } } return null; }
private String formatDetailedSubject( LinkedList<String> subjects ) { StringBuilder string = new StringBuilder(); for ( Iterator<String> it = subjects.descendingIterator(); it.hasNext(); ) { string.append( it.next() ); if ( it.hasNext() ) { string.append( " " ); } } return string.toString(); } }
public K poll() { synchronized (_lock) { Iterator<LinkedBlockingDeque<K>> itr = _buckets.descendingIterator(); while (itr.hasNext()) { LinkedBlockingDeque<K> bucket = itr.next(); K entry = bucket.poll(); if (entry != null) { return entry; } } return null; } }
public boolean removeLastOccurrence(Object o) { if (o == null) return false; lock.lock(); try { for (Iterator<E> it = list.descendingIterator(); it.hasNext();) { E e = it.next(); if (o.equals(e)) { it.remove(); return true; } } return false; } finally { lock.unlock(); } }
private boolean validateSuffixList(LinkedList<ImmutableSegment> suffix) { if(suffix.isEmpty()) { // empty suffix is always valid return true; } Iterator<ImmutableSegment> pipelineBackwardIterator = pipeline.descendingIterator(); Iterator<ImmutableSegment> suffixBackwardIterator = suffix.descendingIterator(); ImmutableSegment suffixCurrent; ImmutableSegment pipelineCurrent; for( ; suffixBackwardIterator.hasNext(); ) { if(!pipelineBackwardIterator.hasNext()) { // a suffix longer than pipeline is invalid return false; } suffixCurrent = suffixBackwardIterator.next(); pipelineCurrent = pipelineBackwardIterator.next(); if(suffixCurrent != pipelineCurrent) { // non-matching suffix return false; } } // suffix matches pipeline suffix return true; }
@Override protected void notifyHandlers(Phase phase) { Iterator<MessageProcessingContext<T>> iterator = phase.isReverseCallbackOrder() ? new LinkedList<>(processingContexts).descendingIterator() : processingContexts.iterator(); iterator.forEachRemaining(context -> (processingContext = context).notifyHandlers(this, phase)); }
/** * Get the counter values in ascending order * @return */ public double[] getCounters() { double[] counters = new double[size()]; int index = 0; if (this.descending == true) { Iterator<Counter<T>> iterator = counterList.descendingIterator(); while (iterator.hasNext()) { Counter<T> b = iterator.next(); counters[index] = b.count; index++; } } else { throw new IllegalStateException(); // support in future } assert index == size(); return counters; }
public PassportItem findStateBackwards(PassportState state) { Iterator itr = history.descendingIterator(); while (itr.hasNext()) { PassportItem item = (PassportItem) itr.next(); if (item.getState() == state) { return item; } } return null; }
Iterator<ProcedureWALFile> it = logs.descendingIterator();
String operator = null; for (Iterator<Identifiable> it = input.descendingIterator(); it.hasNext();) { Identifiable identifiable = it.next(); if (operator == null) {
iterator = wordLinkedList.descendingIterator(); pre = iterator.next(); while (iterator.hasNext())
iterator = wordLinkedList.descendingIterator(); pre = iterator.next(); while (iterator.hasNext())
Iterator<Instruction> it = precedingInstructions.descendingIterator();
if (!locs.isEmpty()) { if (cand.serializable()) { Iterator<GridCacheMvccCandidate> it = locs.descendingIterator();
protected TransactionAttachment detach(String name) { Iterator<StackElement> it = _stack.descendingIterator(); while (it.hasNext()) { StackElement element = it.next(); if (element.type == ATTACHMENT) { TransactionAttachment att = (TransactionAttachment)element.ref; if (name.equals(att.getName())) { it.remove(); return att; } } } assert false : "Are you sure you attached this: " + name; return null; }
private Method replaceWithOverriddenOrInterfaceMethod(Method method, List<Method> allMethodsOfType) { LinkedList<Method> list = new LinkedList<>( allMethodsOfType ); Iterator<Method> iterator = list.descendingIterator(); while ( iterator.hasNext() ) { Method overriddenOrInterfaceMethod = iterator.next(); if ( executableHelper.overrides( method, overriddenOrInterfaceMethod ) ) { if ( method.getAnnotation( ValidateOnExecution.class ) != null ) { throw log.getValidateOnExecutionOnOverriddenOrInterfaceMethodException( method ); } return overriddenOrInterfaceMethod; } } return method; } }