当前位置: 首页>>代码示例>>Java>>正文


Java Stack.remove方法代码示例

本文整理汇总了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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:25,代码来源:PLA_AbsListView$RecycleBin.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:MarkupAbstractIndenter.java

示例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;
    }
}
 
开发者ID:Shmilyz,项目名称:Swap,代码行数:40,代码来源:PLA_AbsListView.java


注:本文中的java.util.Stack.remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。