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


Java LinkedList.peekLast方法代码示例

本文整理汇总了Java中java.util.LinkedList.peekLast方法的典型用法代码示例。如果您正苦于以下问题:Java LinkedList.peekLast方法的具体用法?Java LinkedList.peekLast怎么用?Java LinkedList.peekLast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.LinkedList的用法示例。


在下文中一共展示了LinkedList.peekLast方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: adjustEndGlyphs

import java.util.LinkedList; //导入方法依赖的package包/类
private void adjustEndGlyphs(LinkedList<GSLayoutGlyph> glyphs) {
    // Compress last none CRLF glyph if possible
    GSLayoutGlyph lastGlyph = glyphs.getLast();
    GSLayoutGlyph crlfGlyph = null;
    if (GSCharUtils.isNewline(lastGlyph.code()) && glyphs.size() > 1) {
        crlfGlyph = lastGlyph;
        glyphs.removeLast();
        lastGlyph = glyphs.peekLast();
    }
    if (GSCharUtils.shouldCompressEnd(lastGlyph) && GSCharUtils.canCompress(lastGlyph)) {
        lastGlyph.compressEnd = lastGlyph.size * builder.punctuationCompressRate;
    }
    if (lastGlyph.code() == ' ') {
        lastGlyph.compressEnd = lastGlyph.size;
    }
    if (crlfGlyph != null) {
        if (builder.vertical) {
            crlfGlyph.y = lastGlyph.getUsedEndSize();
        } else {
            crlfGlyph.x = lastGlyph.getUsedEndSize();
        }
        glyphs.addLast(crlfGlyph);
    }
}
 
开发者ID:geansea,项目名称:GSLayout,代码行数:25,代码来源:GSLayout.java

示例2: adjustTts

import java.util.LinkedList; //导入方法依赖的package包/类
static List<TimeToSampleBox.Entry> adjustTts(List<TimeToSampleBox.Entry> source, double timeScaleFactor, long[] syncSample, long[] syncSampleTimes) {

        long[] sourceArray = TimeToSampleBox.blowupTimeToSamples(source);
        long summedDurations = 0;

        LinkedList<TimeToSampleBox.Entry> entries2 = new LinkedList<TimeToSampleBox.Entry>();
        for (int i = 1; i <= sourceArray.length; i++) {
            long duration = sourceArray[i - 1];

            long x = Math.round(timeScaleFactor * duration);


            TimeToSampleBox.Entry last = entries2.peekLast();
            int ssIndex;
            if ((ssIndex = Arrays.binarySearch(syncSample, i + 1)) >= 0) {
                // we are at the sample before sync point
                if (syncSampleTimes[ssIndex] != summedDurations) {
                    long correction = syncSampleTimes[ssIndex] - (summedDurations + x);
                    LOG.finest(String.format("Sample %d %d / %d - correct by %d", i, summedDurations, syncSampleTimes[ssIndex], correction));
                    x += correction;
                }
            }
            summedDurations += x;
            if (last == null) {
                entries2.add(new TimeToSampleBox.Entry(1, x));
            } else if (last.getDelta() != x) {
                entries2.add(new TimeToSampleBox.Entry(1, x));
            } else {
                last.setCount(last.getCount() + 1);
            }

        }
        return entries2;
    }
 
开发者ID:begeekmyfriend,项目名称:mp4parser_android,代码行数:35,代码来源:ChangeTimeScaleTrack.java

示例3: getSkillEvasionTypeValue

import java.util.LinkedList; //导入方法依赖的package包/类
public double getSkillEvasionTypeValue(int magicType)
{
	final LinkedList<Double> skillEvasions = _skillEvasionStat.get(magicType);
	if ((skillEvasions != null) && !skillEvasions.isEmpty())
	{
		return skillEvasions.peekLast();
	}
	return 0d;
}
 
开发者ID:rubenswagner,项目名称:L2J-Global,代码行数:10,代码来源:CharStat.java

示例4: transferThroughList

import java.util.LinkedList; //导入方法依赖的package包/类
private String transferThroughList(String in, int index) {
    LinkedList<String> list = new LinkedList<String>();
    list.add(System.getenv("")); // taints the list
    list.clear(); // makes the list safe again
    list.add(1, "xx");
    list.addFirst(in); // can taint the list
    list.addLast("yy");
    list.push(in);
    return list.element() + list.get(index) + list.getFirst() + list.getLast()
            + list.peek() + list.peekFirst() + list.peekLast() + list.poll()
            + list.pollFirst() + list.pollLast() + list.pop() + list.remove()
            + list.remove(index) + list.removeFirst() + list.removeLast()
            + list.set(index, "safe") + list.toString();
}
 
开发者ID:blackarbiter,项目名称:Android_Code_Arbiter,代码行数:15,代码来源:CommandInjection.java

示例5: cacheAncestors

import java.util.LinkedList; //导入方法依赖的package包/类
/**
 * Does a 'breadth first' search of ancestors, caching as it goes
 * @param nodeIds initial list of nodes to visit
 * @return all visited nodes, in no particular order
 */
private List<Long> cacheAncestors(List<Long> nodeIds)
{
    final LinkedList<Long> toVisit = new LinkedList<Long>(nodeIds);
    Set<Long> visited = new TreeSet<Long>();
    Long nodeId;
    nodeDAO.cacheNodesById(toVisit);
    Long lastCached = toVisit.peekLast();
    while ((nodeId = toVisit.pollFirst()) != null)
    {
        if (visited.add(nodeId) && (nodeDAO.getNodeIdStatus(nodeId) != null) && (false == nodeDAO.getNodeIdStatus(nodeId).isDeleted()))
        {
            nodeDAO.getParentAssocs(nodeId, null, null, null, new ChildAssocRefQueryCallback()
            {
                @Override
                public boolean preLoadNodes()
                {
                    return false;
                }

                @Override
                public boolean orderResults()
                {
                    return false;
                }

                @Override
                public boolean handle(Pair<Long, ChildAssociationRef> childAssocPair,
                        Pair<Long, NodeRef> parentNodePair, Pair<Long, NodeRef> childNodePair)
                {
                    toVisit.add(parentNodePair.getFirst());
                    return true;
                }

                @Override
                public void done()
                {
                }
            });
        }
        final boolean nodeIdEqualsLastCached = (nodeId == null && lastCached == null) ||
                                               (nodeId != null && nodeId.equals(lastCached));
        if (nodeIdEqualsLastCached && !toVisit.isEmpty())
        {
            nodeDAO.cacheNodesById(toVisit);
            lastCached = toVisit.peekLast();
        }
    }
    return new ArrayList<Long>(visited);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:55,代码来源:SOLRTrackingComponentImpl.java


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