本文整理了Java中java.util.LinkedList.descendingIterator()
方法的一些代码示例,展示了LinkedList.descendingIterator()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LinkedList.descendingIterator()
方法的具体详情如下:
包路径:java.util.LinkedList
类名称:LinkedList
方法名:descendingIterator
暂无
代码示例来源:origin: hankcs/HanLP
/**
* 获取某一行的逆序迭代器
*
* @param line 行号
* @return 逆序迭代器
*/
public Iterator<Vertex> descendingIterator(int line)
{
return vertexes[line].descendingIterator();
}
代码示例来源:origin: apache/hive
public Iterator<E> descendingIterator() {
return list.descendingIterator();
}
}
代码示例来源:origin: apache/kylin
@Override
public Iterator<Counter<T>> iterator() {
if (this.descending == true) {
return this.counterList.descendingIterator();
} else {
throw new IllegalStateException(); // support in future
}
}
代码示例来源:origin: killbill/killbill
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;
}
代码示例来源:origin: Netflix/zuul
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;
}
代码示例来源:origin: pentaho/pentaho-kettle
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();
}
}
代码示例来源:origin: alibaba/jstorm
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;
}
}
代码示例来源:origin: apache/hive
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();
}
}
代码示例来源:origin: apache/hbase
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;
}
代码示例来源:origin: AxonFramework/AxonFramework
@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));
}
代码示例来源:origin: apache/kylin
/**
* 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;
}
代码示例来源:origin: Netflix/zuul
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;
}
代码示例来源:origin: apache/hbase
Iterator<ProcedureWALFile> it = logs.descendingIterator();
代码示例来源:origin: EngineHub/WorldEdit
String operator = null;
for (Iterator<Identifiable> it = input.descendingIterator(); it.hasNext();) {
Identifiable identifiable = it.next();
if (operator == null) {
代码示例来源:origin: hankcs/HanLP
iterator = wordLinkedList.descendingIterator();
pre = iterator.next();
while (iterator.hasNext())
代码示例来源:origin: hankcs/HanLP
iterator = wordLinkedList.descendingIterator();
pre = iterator.next();
while (iterator.hasNext())
代码示例来源:origin: find-sec-bugs/find-sec-bugs
Iterator<Instruction> it = precedingInstructions.descendingIterator();
代码示例来源:origin: apache/ignite
if (!locs.isEmpty()) {
if (cand.serializable()) {
Iterator<GridCacheMvccCandidate> it = locs.descendingIterator();
代码示例来源:origin: apache/cloudstack
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;
}
代码示例来源:origin: hibernate/hibernate-validator
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;
}
}
内容来源于网络,如有侵权,请联系作者删除!