本文整理汇总了Java中java.util.Stack.remove方法的典型用法代码示例。如果您正苦于以下问题:Java Stack.remove方法的具体用法?Java Stack.remove怎么用?Java Stack.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Stack
的用法示例。
在下文中一共展示了Stack.remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getScrapView
import java.util.Stack; //导入方法依赖的package包/类
View getScrapView(int position) {
DebugUtil.i("getFromScrap: " + position);
if (this.this$0.getHeaderViewsCount() > position) {
return null;
}
Stack<View> scrapViews;
if (this.mViewTypeCount == 1) {
scrapViews = this.mCurrentScrap;
} else {
int whichScrap = this.this$0.mAdapter.getItemViewType(position);
if (whichScrap < 0 || whichScrap >= this.mScrapViews.length) {
return null;
}
scrapViews = this.mScrapViews[whichScrap];
}
int size = scrapViews.size();
for (int i = size - 1; i >= 0; i--) {
if (((LayoutParams) ((View) scrapViews.get(i)).getLayoutParams())
.scrappedFromPosition == position) {
return (View) scrapViews.remove(i);
}
}
return size > 0 ? (View) scrapViews.remove(0) : null;
}
示例2: discardProcessedMarkupItems
import java.util.Stack; //导入方法依赖的package包/类
private void discardProcessedMarkupItems(Stack<MarkupItem> stack, int startIndex, int endIndex) {
for (int index = endIndex; index >= startIndex; index--) {
MarkupItem item = stack.get(index);
// #198659 - when a document is not valid (eg. accicentally a tag was not closed)
// then below assert can be triggered; disabling it for now
//assert item.processed || item.virtual : "assumption here is that a tag within process tag must be either processed or perhaps virtual: item="+item+" stack="+(getStack().size() < 30 ? getStack() : "[too many items]");
stack.remove(index);
}
}
示例3: getScrapView
import java.util.Stack; //导入方法依赖的package包/类
/**
* @return A view from the ScrapViews collection. These are unordered.
*/
View getScrapView(int position) {
DebugUtil.i("getFromScrap: " + position);
if(getHeaderViewsCount() > position){
//non scraped view.
return null;
}
final Stack<View> scrapViews;
if (mViewTypeCount == 1) {
scrapViews = mCurrentScrap;
} else {
final int whichScrap = mAdapter.getItemViewType(position);
if (whichScrap >= 0 && whichScrap < mScrapViews.length) {
scrapViews = mScrapViews[whichScrap];
} else {
return null;
}
}
// look for the exact same layout
int size = scrapViews.size();
for(int i = size - 1; i >= 0; --i) {
final LayoutParams lp = (LayoutParams) scrapViews.get(i).getLayoutParams();
if(lp.scrappedFromPosition == position) {
return scrapViews.remove(i);
}
}
if (size > 0) {
// reused the oldest one.
return scrapViews.remove(0);
} else {
return null;
}
}