本文整理了Java中java.util.Stack.indexOf()
方法的一些代码示例,展示了Stack.indexOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stack.indexOf()
方法的具体详情如下:
包路径:java.util.Stack
类名称:Stack
方法名:indexOf
暂无
代码示例来源:origin: apache/hive
@SuppressWarnings("unchecked")
private Operator<? extends OperatorDesc> getParentFromStack(Node currentMergeJoinOperator,
Stack<Node> stack) {
int pos = stack.indexOf(currentMergeJoinOperator);
return (Operator<? extends OperatorDesc>) stack.get(pos - 1);
}
代码示例来源:origin: apache/drill
@SuppressWarnings("unchecked")
private Operator<? extends OperatorDesc> getParentFromStack(Node currentMergeJoinOperator,
Stack<Node> stack) {
int pos = stack.indexOf(currentMergeJoinOperator);
return (Operator<? extends OperatorDesc>) stack.get(pos - 1);
}
代码示例来源:origin: jenkinsci/jenkins
private void detectedCycle(N q) throws CycleDetectedException {
int i = path.indexOf(q);
path.push(q);
reactOnCycle(q, path.subList(i, path.size()));
}
代码示例来源:origin: JingYeoh/FragmentRigger
@Nullable
private Activity getPreActivity() {
if (mPuppetHost instanceof Activity) {
Stack<Activity> stack = SwipeActivityManager.getInstance().getActivityStack();
int index = stack.indexOf(mPuppetHost);
if (index <= 0) {
return null;
}
return stack.get(index - 1);
}
return null;
}
代码示例来源:origin: bingoogolapple/BGASwipeBackLayout-Android
/**
* 获取倒数第二个 Activity
*
* @return
*/
@Nullable
public Activity getPenultimateActivity(Activity currentActivity) {
Activity activity = null;
try {
if (mActivityStack.size() > 1) {
activity = mActivityStack.get(mActivityStack.size() - 2);
if (currentActivity.equals(activity)) {
int index = mActivityStack.indexOf(currentActivity);
if (index > 0) {
// 处理内存泄漏或最后一个 Activity 正在 finishing 的情况
activity = mActivityStack.get(index - 1);
} else if (mActivityStack.size() == 2) {
// 处理屏幕旋转后 mActivityStack 中顺序错乱
activity = mActivityStack.lastElement();
}
}
}
} catch (Exception e) {
}
return activity;
}
代码示例来源:origin: apache/tinkerpop
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
final B_LP_NL_O_S_SE_SL_Traverser<R> clone = (B_LP_NL_O_S_SE_SL_Traverser<R>) super.split(r, step);
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public Admin<T> split() {
final B_LP_NL_O_P_S_SE_SL_Traverser<T> clone = (B_LP_NL_O_P_S_SE_SL_Traverser<T>) super.split();
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public Admin<T> split() {
final B_LP_NL_O_S_SE_SL_Traverser<T> clone = (B_LP_NL_O_S_SE_SL_Traverser<T>) super.split();
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
final LP_NL_O_OB_P_S_SE_SL_Traverser<R> clone = (LP_NL_O_OB_P_S_SE_SL_Traverser<R>) super.split(r, step);
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public Admin<T> split() {
final NL_O_OB_S_SE_SL_Traverser<T> clone = (NL_O_OB_S_SE_SL_Traverser<T>) super.split();
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
final LP_NL_O_OB_S_SE_SL_Traverser<R> clone = (LP_NL_O_OB_S_SE_SL_Traverser<R>) super.split(r, step);
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public Admin<T> split() {
final B_NL_O_S_SE_SL_Traverser<T> clone = (B_NL_O_S_SE_SL_Traverser<T>) super.split();
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
final B_NL_O_S_SE_SL_Traverser<R> clone = (B_NL_O_S_SE_SL_Traverser<R>) super.split(r, step);
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
final NL_O_OB_S_SE_SL_Traverser<R> clone = (NL_O_OB_S_SE_SL_Traverser<R>) super.split(r, step);
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public Admin<T> split() {
final LP_NL_O_OB_P_S_SE_SL_Traverser<T> clone = (LP_NL_O_OB_P_S_SE_SL_Traverser<T>) super.split();
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
final B_LP_NL_O_P_S_SE_SL_Traverser<R> clone = (B_LP_NL_O_P_S_SE_SL_Traverser<R>) super.split(r, step);
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: apache/tinkerpop
@Override
public Admin<T> split() {
final LP_NL_O_OB_S_SE_SL_Traverser<T> clone = (LP_NL_O_OB_S_SE_SL_Traverser<T>) super.split();
clone.nestedLoops = new Stack<>();
for(LabelledCounter lc : this.nestedLoops)
clone.nestedLoops.push((LabelledCounter) lc.clone());
if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
}
}
return clone;
}
代码示例来源:origin: cincheo/jsweet
return;
int i = scanningStack.indexOf(from);
if (i == -1 || i == 0) {
return;
代码示例来源:origin: smuyyh/SprintNBA
static SwipeBackPage getPrePage(SwipeBackPage activity){
int index = mPageStack.indexOf(activity);
if (index>0)return mPageStack.get(index-1);
else return null;
}
代码示例来源:origin: com.sun.faces/jsf-impl
public UIComponent getParentCompositeComponent(FacesContext ctx, UIComponent forComponent) {
Stack<UIComponent> s = getStack(false);
if (s == null) {
return null;
} else {
int idx = s.indexOf(forComponent);
if (idx == 0) { // no parent
return null;
}
return (s.get(idx - 1));
}
}
内容来源于网络,如有侵权,请联系作者删除!