Package javolution.util

Examples of javolution.util.FastList$Node


  public List getResultColumns(ResultSet aResultSet, int aColCount) {
    // String blobStr = null;

    // TODO: should work with usual arrays!
    List lDataRow = new FastList();
    Object lObj = null;

    try {
      for (int i = 1; i <= aColCount; i++) {
        lObj = aResultSet.getObject(i);
        lDataRow.add(lObj);
        /*
        if (obj == null) {
        // nothing todo
        } else if (obj instanceof byte[]) {
        blobStr = new String((byte[]) obj);
View Full Code Here


public class SharedLists {

  private Map<String, FastList> mLists = new FastMap<String, FastList>();

  public void create(Token aResponse, String aId) {
    FastList lList = mLists.get(aId);
    if (lList != null) {
      mLists.put(aId, new FastList());
    }
  }
View Full Code Here

        );
    Logging.initLogs(lLoggingConfig, new String[]{"%JWEBSOCKET_HOME%/logs", "%CATALINA_HOME%/logs"});
    mLog = Logging.getLogger(JWebSocketEmbedded.class);

    // initialize the engine
    List lDomains = new FastList();
    lDomains.add("http://jwebsocket.org");
    EngineConfiguration lEngineConfig = new EngineConfig(
        "tcp0", // id
        "org.jwebsocket.tcp.engines.TCPEngine", // name
        "-", // jar, needs to be in classpath, i.e. embedded in .jar'/manifest
        8787, // port
View Full Code Here

        return null; // Not bound.
    }

    // Implements NamespaceContext
    public Iterator getPrefixes(CharSequence namespaceURI) {
        FastList prefixes = new FastList();
        for (int i = _namespacesCount[_nesting]; --i >= 0;) {
            if (_namespaces[i].equals(namespaceURI)) {
                prefixes.add(_prefixes[i]);
            }
        }
        return prefixes.iterator();
    }
View Full Code Here

            }

            values.add(shipGroup);

            //set estimated ship dates
            FastList estimatedShipDates = FastList.newInstance();
            for (ShoppingCartItem item : shipItemInfo.keySet()) {
                Timestamp estimatedShipDate = item.getEstimatedShipDate();
                if (estimatedShipDate != null) {
                    estimatedShipDates.add(estimatedShipDate);
                }
            }
            if (estimatedShipDates.size() > 0) {
                Collections.sort(estimatedShipDates);
                Timestamp estimatedShipDate  = (Timestamp) estimatedShipDates.getLast();
                shipGroup.set("estimatedShipDate", estimatedShipDate);
            }

            //set estimated delivery dates
            FastList estimatedDeliveryDates = FastList.newInstance();
            for (ShoppingCartItem item : shipItemInfo.keySet()) {
                Timestamp estimatedDeliveryDate = item.getDesiredDeliveryDate();
                if (estimatedDeliveryDate != null) {
                    estimatedDeliveryDates.add(estimatedDeliveryDate);
                }
            }
            if (UtilValidate.isNotEmpty(estimatedDeliveryDates)) {
                Collections.sort(estimatedDeliveryDates);
                Timestamp estimatedDeliveryDate = (Timestamp) estimatedDeliveryDates.getLast();
                shipGroup.set("estimatedDeliveryDate", estimatedDeliveryDate);
            }

            // create the shipping estimate adjustments
            if (shipEstimate.compareTo(BigDecimal.ZERO) != 0) {
View Full Code Here

            }

            values.add(shipGroup);

            //set estimated ship dates
            FastList estimatedShipDates = FastList.newInstance();
            for (ShoppingCartItem item : shipItemInfo.keySet()) {
                Timestamp estimatedShipDate = item.getEstimatedShipDate();
                if (estimatedShipDate != null) {
                    estimatedShipDates.add(estimatedShipDate);
                }
            }
            if (estimatedShipDates.size() > 0) {
                Collections.sort(estimatedShipDates);
                Timestamp estimatedShipDate  = (Timestamp) estimatedShipDates.getLast();
                shipGroup.set("estimatedShipDate", estimatedShipDate);
            }

            //set estimated delivery dates
            FastList estimatedDeliveryDates = FastList.newInstance();
            for (ShoppingCartItem item : shipItemInfo.keySet()) {
                Timestamp estimatedDeliveryDate = item.getDesiredDeliveryDate();
                if (estimatedDeliveryDate != null) {
                    estimatedDeliveryDates.add(estimatedDeliveryDate);
                }
            }
            if (UtilValidate.isNotEmpty(estimatedDeliveryDates)) {
                Collections.sort(estimatedDeliveryDates);
                Timestamp estimatedDeliveryDate = (Timestamp) estimatedDeliveryDates.getLast();
                shipGroup.set("estimatedDeliveryDate", estimatedDeliveryDate);
            }

            // create the shipping estimate adjustments
            if (shipEstimate.compareTo(BigDecimal.ZERO) != 0) {
View Full Code Here

            long pauseLong = filePause != null ? filePause.longValue() : 0;
            File baseDir = new File(path);

            if (baseDir.isDirectory() && baseDir.canRead()) {
                File[] fileArray = baseDir.listFiles();
                FastList files = FastList.newInstance();
                for (int a=0; a<fileArray.length; a++){
                    if (fileArray[a].getName().toUpperCase().endsWith("XML")) {
                        files.add(fileArray[a]);
                    }
                }               

                int passes=0;               
                int initialListSize = files.size();
                int lastUnprocessedFilesCount = 0;
                FastList unprocessedFiles = FastList.newInstance();
                while (files.size()>0 &&
                        files.size() != lastUnprocessedFilesCount) {
                    lastUnprocessedFilesCount = files.size();
                    unprocessedFiles = FastList.newInstance();
                    Iterator filesItr = files.iterator();
                    while (filesItr.hasNext()) {
                        Map parseEntityXmlFileArgs = UtilMisc.toMap("mostlyInserts", mostlyInserts,
                                "createDummyFks", createDummyFks,
                                "checkDataOnly", checkDataOnly,
                                "maintainTimeStamps", maintainTimeStamps,
                                "txTimeout", txTimeout,
                                "userLogin", userLogin);
                       
                        File f = (File) filesItr.next();
                        try {
                            URL furl = f.toURI().toURL();
                            parseEntityXmlFileArgs.put("url", furl);
                            Map outputMap = dispatcher.runSync("parseEntityXmlFile", parseEntityXmlFileArgs);
                            Long numberRead = (Long) outputMap.get("rowProcessed");
                            messages.add("Got " + numberRead.longValue() + " entities from " + f);
                            if (deleteFiles) {
                                messages.add("Deleting " + f);
                                f.delete();
                            }
                        } catch(Exception e) {
                            unprocessedFiles.add(f);
                            messages.add("Failed " + f + " adding to retry list for next pass");
                        }
                        // pause in between files
                        if (pauseLong > 0) {
                            Debug.log("Pausing for [" + pauseLong + "] seconds - " + UtilDateTime.nowTimestamp());
                            try {
                                Thread.sleep((pauseLong * 1000));
                            } catch(InterruptedException ie) {
                                Debug.log("Pause finished - " + UtilDateTime.nowTimestamp());
                            }
                        }
                    }
                    files = unprocessedFiles;
                    passes++;
                    messages.add("Pass " + passes + " complete");
                    Debug.logInfo("Pass " + passes + " complete", module);
                }
                lastUnprocessedFilesCount=unprocessedFiles.size();
                messages.add("---------------------------------------");
                messages.add("Succeeded: " + (initialListSize-lastUnprocessedFilesCount) + " of " + initialListSize);
                messages.add("Failed:    " + lastUnprocessedFilesCount + " of " + initialListSize);
                messages.add("---------------------------------------");
                messages.add("Failed Files:");
                Iterator unprocessedFilesItr = unprocessedFiles.iterator();
                while (unprocessedFilesItr.hasNext()) {
                    File file = (File) unprocessedFilesItr.next();
                    messages.add("" + file);
                }
            } else {
View Full Code Here

            long pauseLong = filePause != null ? filePause.longValue() : 0;
            File baseDir = new File(path);

            if (baseDir.isDirectory() && baseDir.canRead()) {
                File[] fileArray = baseDir.listFiles();
                FastList files = FastList.newInstance();
                for (int a=0; a<fileArray.length; a++){
                    if (fileArray[a].getName().toUpperCase().endsWith("XML")) {
                        files.add(fileArray[a]);
                    }
                }               

                int passes=0;               
                int initialListSize = files.size();
                int lastUnprocessedFilesCount = 0;
                FastList unprocessedFiles = FastList.newInstance();
                while (files.size()>0 &&
                        files.size() != lastUnprocessedFilesCount) {
                    lastUnprocessedFilesCount = files.size();
                    unprocessedFiles = FastList.newInstance();
                    Iterator filesItr = files.iterator();
                    while (filesItr.hasNext()) {
                        Map parseEntityXmlFileArgs = UtilMisc.toMap("mostlyInserts", mostlyInserts,
                                "createDummyFks", createDummyFks,
                                "maintainTimeStamps", maintainTimeStamps,
                                "txTimeout", txTimeout,
                                "userLogin", userLogin);
                       
                        File f = (File) filesItr.next();
                        try {
                            URL furl = f.toURI().toURL();
                            parseEntityXmlFileArgs.put("url", furl);
                            Map outputMap = dispatcher.runSync("parseEntityXmlFile", parseEntityXmlFileArgs);
                            Long numberRead = (Long) outputMap.get("rowProcessed");
                            messages.add("Got " + numberRead.longValue() + " entities from " + f);
                            if (deleteFiles) {
                                messages.add("Deleting " + f);
                                f.delete();
                            }
                        } catch(Exception e) {
                            unprocessedFiles.add(f);
                            messages.add("Failed " + f + " adding to retry list for next pass");
                        }
                        // pause in between files
                        if (pauseLong > 0) {
                            Debug.log("Pausing for [" + pauseLong + "] seconds - " + UtilDateTime.nowTimestamp());
                            try {
                                Thread.sleep((pauseLong * 1000));
                            } catch(InterruptedException ie) {
                                Debug.log("Pause finished - " + UtilDateTime.nowTimestamp());
                            }
                        }
                    }
                    files = unprocessedFiles;
                    passes++;
                    messages.add("Pass " + passes + " complete");
                    Debug.logInfo("Pass " + passes + " complete", module);
                }
                lastUnprocessedFilesCount=unprocessedFiles.size();
                messages.add("---------------------------------------");
                messages.add("Succeeded: " + (initialListSize-lastUnprocessedFilesCount) + " of " + initialListSize);
                messages.add("Failed:    " + lastUnprocessedFilesCount + " of " + initialListSize);
                messages.add("---------------------------------------");
                messages.add("Failed Files:");
                Iterator unprocessedFilesItr = unprocessedFiles.iterator();
                while (unprocessedFilesItr.hasNext()) {
                    File file = (File) unprocessedFilesItr.next();
                    messages.add("" + file);
                }
            } else {
View Full Code Here

    // create list for SortContainers...
    final LinkedList<SortContainer> scl = new LinkedList<SortContainer>();

    // walk through children...
    for (int i = 0; i < node.jjtGetNumChildren(); ++i) {
      Node n = node.jjtGetChild(i); // get current child

      boolean desc = false; // set order ASC as default

      // current node is Order node...
      if (n instanceof ASTAscOrder || n instanceof ASTDescOrder) {
        if (n instanceof ASTDescOrder) // reset order value to DESC...
          desc = true;

        i++; // increase counter to get next child (which is sort
        // condition)
      }

      n = node.jjtGetChild(i); // get next child (which is sort condition)

      // parse node with the filter...
      final SPARQLParserVisitorImplementationDumper filterDumper = new SPARQLParserVisitorImplementationDumper();
      final String sortString = n.accept(filterDumper);

      try {
        final SortContainer sc = new SortContainer(this.prefix, desc,
            sortString); // create SortContainer
View Full Code Here

  @SuppressWarnings("unchecked")
  public Object visit(final ASTTripleSet node, final Object data) {
    final Item[] item = { null, null, null };

    for (int i = 0; i < 3; i++) {
      final Node n = node.jjtGetChild(i);
      item[i] = lupos.sparql1_1.operatorgraph.SPARQLCoreParserVisitorImplementation.getItem(n);
    }

    final HashMap<Item, QueryRDFTerm> rdfHash = (HashMap<Item, QueryRDFTerm>) data;
View Full Code Here

TOP

Related Classes of javolution.util.FastList$Node

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.