Package org.apache.commons.collections.map

Examples of org.apache.commons.collections.map.ListOrderedMap


    /**
    * Remove the stamp from stack (when resuming)
    */
    private static void popTransactionStartStamp() {
        ListOrderedMap map = (ListOrderedMap) suspendedTxStartStamps.get();
        if (map.size() > 0) {
            transactionStartStamp.set((Timestamp) map.remove(map.lastKey()));
        } else {
            Debug.logError("Error in transaction handling - no saved start stamp found - using NOW.", module);
            transactionStartStamp.set(UtilDateTime.nowTimestamp());
        }
    }
View Full Code Here


        foreignKeys = new ArrayList(5);
        indices = new ArrayList(5);
        unices = new ArrayList(5);
        columnsByName = new Hashtable();
        columnsByJavaName = new Hashtable();
        options = Collections.synchronizedMap(new ListOrderedMap());
    }
View Full Code Here

     * parent table, small column list size allocation, non-unique).
     */
    public Index()
    {
        indexColumns = new ArrayList(3);
        options = Collections.synchronizedMap(new ListOrderedMap());
    }
View Full Code Here

     * @param name column name
     */
    public Column(String name)
    {
        this.name = name;
        options = Collections.synchronizedMap(new ListOrderedMap());
    }
View Full Code Here

   */
  public LanguageVariantDependentValuesMatrix() {
    super();

    // initialize map
    elementMatrix = new ListOrderedMap();
    propertyMatrix = new ListOrderedMap();
  }
View Full Code Here

   * Remember the given page headline under the given language variant.
   */
  public void addProperty(String property, String value, LanguageVariant languageVariant) throws RQLException {
    if (propertyMatrix.containsKey(property)) {
      // add at existing property new language variant value
      ListOrderedMap lvMap = getPropertyMap(property);
      lvMap.put(languageVariant, value);
    } else {
      // initialize new property at all
      ListOrderedMap lvMap = new ListOrderedMap();
      lvMap.put(languageVariant, value);
      propertyMatrix.put(property, lvMap);
    }
  }
View Full Code Here

    // add
    TemplateElement templateElement = contentElement.getTemplateElement();
    if (elementMatrix.containsKey(templateElement)) {
      // add for new language variant
      ListOrderedMap lvMap = getElementMap(templateElement);
      lvMap.put(languageVariant, contentElement);
    } else {
      // initialize new template element
      ListOrderedMap lvMap = new ListOrderedMap();
      lvMap.put(languageVariant, contentElement);
      elementMatrix.put(templateElement, lvMap);
    }
  }
View Full Code Here

    /**
    * Remove the stamp from stack (when resuming)
    */
    private static void popTransactionStartStamp() {
        ListOrderedMap map = (ListOrderedMap) suspendedTxStartStamps.get();
        if (map.size() > 0) {
            transactionStartStamp.set((Timestamp) map.remove(map.lastKey()));
        } else {
            Debug.logError("Error in transaction handling - no saved start stamp found - using NOW.", module);
            transactionStartStamp.set(UtilDateTime.nowTimestamp());
        }
    }
View Full Code Here

    /**
     * Fill the map and list with OIDs from the configuration file
     */
  private static synchronized void fillExtendedKeyUsageOidsAndTexts() {
      final ListOrderedMap map = new ListOrderedMap();
      final Configuration conf = ConfigurationHolder.instance();
      final String ekuname = "extendedkeyusage.name.";
      final String ekuoid = "extendedkeyusage.oid.";
      for (int i = 0; i < 255; i++) {
        final String oid = conf.getString(ekuoid+i);
        if (oid != null) {
          String name = conf.getString(ekuname+i);
          if (name != null) {
            // A null value in the properties file means that we should not use this value, so set it to null for real
            if (name.equalsIgnoreCase("null")) {
              name = null;
            }
            map.put(oid, name);
          } else {
            log.error("Found extended key usage oid "+oid+", but no name defined. Not adding to list of extended key usages.");
          }
        } else {
          // No eku with that number = no more ekus so break,
          log.debug("Read "+i+" extended key usages.");
          break;
        }
      }
      extendedKeyUsageOids = map.asList();
      if (extendedKeyUsageOids == null) {
        log.error("Extended key usage OIDs is null, there is a serious error with extendedkeyusage.properties");
        extendedKeyUsageOids = new ArrayList<String>();
      }
      extendedKeyUsageOidsAndNames = Collections.synchronizedMap(map);
View Full Code Here

    }

    private List<Diff> compare(JCRNodeWrapper frozenNode, JCRNodeWrapper node, String basePath) throws RepositoryException {
        List<Diff> diffs = new ArrayList<Diff>();

        ListOrderedMap uuids1 = getChildEntries(frozenNode, node.getSession());
        ListOrderedMap uuids2 = getChildEntries(node, node.getSession());

        if (!uuids1.values().equals(uuids2.values())) {
            for (Iterator iterator = uuids2.keySet().iterator(); iterator.hasNext();) {
                String key = (String) iterator.next();
                if (uuids1.containsKey(key) && !uuids1.get(key).equals(uuids2.get(key))) {
                    diffs.add(new ChildRenamedDiff(key, addPath(basePath,(String) uuids1.get(key)),addPath(basePath, (String) uuids2.get(key))));
                }
            }
        }

        if (!uuids1.keyList().equals(uuids2.keyList())) {
            List<String> added = new ArrayList<String>(uuids2.keySet());
            added.removeAll(uuids1.keySet());
            List<String> removed = new ArrayList<String>(uuids1.keySet());
            removed.removeAll(uuids2.keySet());

            // Ordering
            Map<String,String> oldOrdering = getOrdering(uuids1, removed);
            Map<String,String> newOrdering = getOrdering(uuids2, added);
            if (!newOrdering.equals(oldOrdering)) {
                for (Map.Entry<String, String> entry : newOrdering.entrySet()) {
                    diffs.add(new ChildNodeReorderedDiff(entry.getKey(), newOrdering.get(entry.getKey()),
                            addPath(basePath,(String) uuids2.get(entry.getKey())), (String) uuids2.get(newOrdering.get(entry.getKey())),newOrdering));
                }
            }

            // Removed nodes
            for (String s : removed) {
                try {
                    sourceNode.getSession().getNodeByUUID(s);
                    // Item has been moved
                } catch (ItemNotFoundException e) {
                    diffs.add(new ChildRemovedDiff(s,addPath(basePath, (String) uuids1.get(s))));
                }

            }

            // Added nodes
            for (String s : added) {
                if (s.equals(uuids2.lastKey())) {
                    diffs.add(new ChildAddedDiff(s, addPath(basePath, (String) uuids2.get(s)), null));
                } else {
                    diffs.add(new ChildAddedDiff(s, addPath(basePath, (String) uuids2.get(s)), (String) uuids2.get(uuids2.get(uuids2.indexOf(s)+1))));
                }
            }
        }

        PropertyIterator pi1 = frozenNode.getProperties();
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.map.ListOrderedMap

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.