Examples of LinkedList


Examples of java.util.LinkedList

        }
        if(v == null){
            ArgCheck.isNotNull(v,CorePlugin.Util.getString("JdomHelper.The_XMLVisitor_reference_may_not_be_null_37")); //$NON-NLS-1$
        }

        LinkedList queue = new LinkedList( parent.getChildren() );
        while( queue.size() != 0 ) {
            Element child = (Element)queue.getFirst();
            v.visit( child );
            queue.addAll( child.getChildren() );
            queue.removeFirst();
        }
    }

Examples of java.util.LinkedList

    String tnumstr, fnumstr, newpriostr;
    int tnumber;
    DiskManagerFileInfo[] files;
    String[] sections;
    List args = commandLine.getArgList();
    LinkedList fs,fe;
    DownloadManager dm;
   
    if( args.isEmpty() )
    {
      console.out.println("Torrent # required!");
      return;
    } else {
      tnumstr = (String) args.remove(0);
    }
    if( args.isEmpty() )
    {
      console.out.println("File # required!");
      return;
    } else {
      fnumstr = (String) args.remove(0);
    }

    if ((console.torrents == null) || console.torrents.isEmpty()) {
      console.out.println("> Command 'prio': No torrents in list (try 'show torrents' first).");
      return;
    }
   
    try {
      tnumber = Integer.parseInt(tnumstr);
      if ((tnumber == 0) || (tnumber > console.torrents.size())) {
        console.out.println("> Command 'prio': Torrent #" + tnumber + " unknown.");
        return;
      }

      dm = (DownloadManager) console.torrents.get(tnumber - 1);
      files = dm.getDiskManagerFileInfo();
    }
    catch (Exception e) {
      e.printStackTrace();
      console.out.println("> Command 'prio': Torrent # '" + tnumstr + "' unknown.");
      return;
    }

    if( args.isEmpty() )
    {
      console.out.println("> Command 'prio': missing parameter for new priority");
      return;
    } else {
      newpriostr = (String) args.remove(0);
    }

    if (newpriostr.equalsIgnoreCase("normal")) {
      newprio = NORMAL;
    } else if (newpriostr.equalsIgnoreCase("high")) {
      newprio = HIGH;
    } else if (newpriostr.equalsIgnoreCase("dnd")) {
      newprio = DONOTDOWNLOAD;
    } else if (newpriostr.equalsIgnoreCase("del")) {
      newprio = DELETE;
    } else {
      console.out.println("> Command 'prio': unknown priority "
          + newpriostr);
      return;
    }

    if (fnumstr.equalsIgnoreCase("all")) {
      sections = new String[1];
      sections[0] = "1-"+files.length;
    } else
      sections = fnumstr.split(",");
   
    fs = new LinkedList();
    fe = new LinkedList();
   
    int dash,start,end;
    for (int i=0; i<sections.length; i++) {
      try {
        if ((dash = sections[i].indexOf('-')) != -1) {
          start = Integer.parseInt(sections[i].substring(0,dash));
          end = Integer.parseInt(sections[i].substring(dash+1));
        } else
          start = end = Integer.parseInt(sections[i]);
        if ((start == 0) || (end > files.length)) {
          console.out.println("> Command 'prio': Invalid file range " + sections[i]);
          return;
        }
        if (start > end) {
          console.out.println("> Command 'prio': Invalid file range '"+sections[i]+"'");
        }
       
        // -1 compensates for 0-based offsets
        fs.add(new Integer(start - 1));
        fe.add(new Integer(end - 1));
      } catch (Exception e) {
        console.out.println("> Command 'prio': File # '" + sections[i]
            + "' unknown.");
        return;
      }
    }
   
//    console.out.println("DM was " + dm.getState());
    if ((newprio == DELETE) && (dm.getState() != DownloadManager.STATE_STOPPED)) {
      try {
        dm.stopIt( DownloadManager.STATE_STOPPED, false, false );
      } catch (Exception e) {
        console.out.println("Failed to stop torrent " + tnumber);
        return;
      }
    }
   
//    console.out.println("DM is " + dm.getState());
    int nummod = 0;
    while (fs.size() > 0) {
      start = ((Integer) fs.removeFirst()).intValue();
      end = ((Integer) fe.removeFirst()).intValue();
      for (int i = start; i <= end; i++) {
        nummod++;
        // DEBUG
//        console.out.println("Setting priority for file " + i + " to " + newprio);

Examples of java.util.LinkedList

            if (!proc.isProcedureRelational()) {
                continue;
            }

            HashSet inputSymbols = new HashSet();
            List inputReferences = new LinkedList();
           
            PlanNode critNode = node.getParent();
           
            List conjuncts = new LinkedList();
            HashSet coveredParams = new HashSet();
            //List preExecNodes = new LinkedList();
                       
            for (Iterator params = proc.getInputParameters().iterator(); params.hasNext();) {
                SPParameter param = (SPParameter)params.next();
                ElementSymbol symbol = param.getParameterSymbol();
                Expression input = param.getExpression();
                inputReferences.add(input);
                inputSymbols.add(symbol);
            }
           
            findInputNodes(inputSymbols, critNode, conjuncts, coveredParams);
           
            List defaults = new LinkedList();
           
            for (Iterator params = inputReferences.iterator(); params.hasNext();) {
                Reference ref = (Reference)params.next();
                ElementSymbol symbol = ref.getExpression();
               
                Expression defaultValue = null;
               
                /*try {
                    defaultValue = ResolverUtil.getDefault(symbol, metadata);
                } catch (QueryResolverException qre) {
                    //Just ignore
                }*/
               
                defaults.add(defaultValue);
               
                if (defaultValue == null && !coveredParams.contains(symbol)) {
                    throw new QueryPlannerException(QueryPlugin.Util.getString("RulePlanProcedures.no_values", symbol)); //$NON-NLS-1$
                }
            }

Examples of java.util.LinkedList

     * Adds a TLV object to the list
     */
    protected void addTLV(TLV tlv) {

        if (tlvList == null) {
            tlvList = new LinkedList();
        }

        tlvList.add(tlv);
    }

Examples of java.util.LinkedList

    public static List getTLVs(byte[] byteArray, int pos, int len) {

        List list = null;

        if (byteArray != null) {
            list = new LinkedList();

            int length = len - pos;

            //for (int i = pos; i < pos+len;) {
            for (int i = pos; i < length;) {

Examples of java.util.LinkedList

    private boolean noCheckClose;

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

Examples of java.util.LinkedList

        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();
            }
           

Examples of java.util.LinkedList

       
        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;
    }

Examples of java.util.LinkedList

        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);

Examples of java.util.LinkedList

                }
            }
           
            List instrs = (List)map.get(inst.getClass());
            if (instrs == null) {
                instrs = new LinkedList();
                map.put(inst.getClass(), instrs);
            }
            instrs.add(inst);
        }
        return map;
TOP
Copyright © 2018 www.massapi.com. 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.