Package java.util

Examples of java.util.LinkedList


    private boolean noCheckClose;

    KeepAliveCleaner() {
      super("KeepAlive cleaner");
      connections = new LinkedList();
      ingoings = new LinkedList();
      setDaemon(true);
    }
View Full Code Here


        ModelAndView mv = new ModelAndView(getViewName());
        File file = logDest.getFile();

        if (file.exists()) {
            LinkedList lines = new LinkedList();
            long actualLength = file.length();
            long lastKnownLength = ServletRequestUtils.getLongParameter(request, "lastKnownLength", 0);
            long currentLength = ServletRequestUtils.getLongParameter(request, "currentLength", actualLength);
            long maxReadLines = ServletRequestUtils.getLongParameter(request, "maxReadLines", 0);

            if (lastKnownLength > currentLength
                    || lastKnownLength > actualLength
                    || currentLength > actualLength) {
                //
                // file length got reset
                //
                lastKnownLength = 0;
                lines.add(" ------------- THE FILE HAS BEEN TRUNCATED --------------");
            }

            BackwardsFileStream bfs = new BackwardsFileStream(file, currentLength);
            try {
                BackwardsLineReader br = new BackwardsLineReader(bfs);
                long readSize = 0;
                long totalReadSize = currentLength - lastKnownLength;
                String s;
                while (readSize < totalReadSize && (s = br.readLine()) != null) {
                    if (!s.equals("")){
                        lines.addFirst(s);
                        readSize += s.length();
                    } else {
                        readSize++;
                    }
                    if (maxReadLines != 0 && lines.size() >= maxReadLines) {
                        break;
                    }
                }

                if (lastKnownLength != 0 && readSize > totalReadSize) {
                    lines.removeFirst();
                }
            } finally {
                bfs.close();
            }
           
View Full Code Here

       
        return singleParentage;
    }
   
    private static LinkedList getResultSetStack(MappingSourceNode contextNode, MappingBaseNode node) {
        LinkedList rsStack = new LinkedList();
       
        while (node != null && node != contextNode) {
            if (node instanceof MappingSourceNode) {
                rsStack.add(0, node);
            }
            node = node.getParentNode();
        }
        return rsStack;
    }
View Full Code Here

        List joinCriteria = (List)joinNode.getProperty(NodeConstants.Info.JOIN_CRITERIA);
        Criteria criteria = (Criteria)critNode.getProperty(NodeConstants.Info.SELECT_CRITERIA);
       
        //since the parser uses EMPTY_LIST, check for size 0 also
        if (joinCriteria == null || joinCriteria.size() == 0) {
            joinCriteria = new LinkedList();
            joinNode.setProperty(NodeConstants.Info.JOIN_CRITERIA, joinCriteria);
        }
       
        if (!joinCriteria.contains(criteria)) {
            joinCriteria.add(criteria);
View Full Code Here

                }
            }
           
            List instrs = (List)map.get(inst.getClass());
            if (instrs == null) {
                instrs = new LinkedList();
                map.put(inst.getClass(), instrs);
            }
            instrs.add(inst);
        }
        return map;
View Full Code Here

            return;
        }
       
        Map symbols = element.getSymbolMap();
       
        List elements = new LinkedList();
       
        for (Iterator i = symbols.values().iterator(); i.hasNext();) {
            Object symbol = i.next();
            if (symbol instanceof ElementSymbol) {
                elements.add(symbol);
            }
        }
       
        //fix recusive references
        Map fixedMap = QueryUtil.createSymbolMap(new GroupSymbol(element.getActualResultSetName()), element.getAliasResultName(), elements);
View Full Code Here

        ArrayList crits = new ArrayList(1);
        CompareCriteria crit2 = new CompareCriteria(g1e2, CompareCriteria.EQ, g2e2);
        crits.add(crit2);

        Criteria atomicCrit1 = null;
        Collection values = new LinkedList();
        values.add(new Constant(new Integer(3)));
        values.add(new Constant(new Integer(4)));
        values.add(new Constant(new Integer(5)));
        Criteria atomicCrit2 = new SetCriteria(g2e1, values);
        int expected = LEFT_SIDE;
        helpTestChooseSiblingAndMarkDependent(group1, atomicCrit1, group2, atomicCrit2, crits, expected);       
        expected = RIGHT_SIDE;
        helpTestChooseSiblingAndMarkDependent(group2, atomicCrit2, group1, atomicCrit1, crits, expected);       
View Full Code Here

    private List _fsSelectors = new ArrayList();

    public Ruleset(int orig) {
        _origin = orig;
        _props = new LinkedList();
        _fsSelectors = new LinkedList();
    }
View Full Code Here

        runDirection = org.runDirection;
        descender = org.descender;
        composite = org.composite;
        splittedRow = org.splittedRow;
        if (org.composite) {
            compositeElements = new LinkedList(org.compositeElements);
            if (splittedRow) {
                PdfPTable table = (PdfPTable)compositeElements.getFirst();
                compositeElements.set(0, new PdfPTable(table));
            }
            if (org.compositeColumn != null)
View Full Code Here

        }
        else if (element.type() != Element.PARAGRAPH && element.type() != Element.LIST && element.type() != Element.PTABLE && element.type() != Element.YMARK)
            throw new IllegalArgumentException("Element not allowed.");
        if (!composite) {
            composite = true;
            compositeElements = new LinkedList();
            bidiLine = null;
            waitPhrase = null;
        }
        compositeElements.add(element);
    }
View Full Code Here

TOP

Related Classes of java.util.LinkedList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.