Package java.util

Examples of java.util.SortedMap.entrySet()


        final Object toKey;
       
        public TestHeadMap(AbstractTestMap main) {
            super("SortedMap.HeadMap", main);
            SortedMap sm = (SortedMap) main.makeFullMap();
            for (Iterator it = sm.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Map.Entry) it.next();
                this.subSortedKeys.add(entry.getKey());
                this.subSortedValues.add(entry.getValue());
            }
            this.toKey = this.subSortedKeys.get(SUBSIZE);
View Full Code Here


        final Object invalidKey;
       
        public TestTailMap(AbstractTestMap main) {
            super("SortedMap.TailMap", main);
            SortedMap sm = (SortedMap) main.makeFullMap();
            for (Iterator it = sm.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Map.Entry) it.next();
                this.subSortedKeys.add(entry.getKey());
                this.subSortedValues.add(entry.getValue());
            }
            this.fromKey = this.subSortedKeys.get(this.subSortedKeys.size() - SUBSIZE);
View Full Code Here

        final Object toKey;
       
        public TestSubMap(AbstractTestMap main) {
            super("SortedMap.SubMap", main);
            SortedMap sm = (SortedMap) main.makeFullMap();
            for (Iterator it = sm.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Map.Entry) it.next();
                this.subSortedKeys.add(entry.getKey());
                this.subSortedValues.add(entry.getValue());
            }
            this.fromKey = this.subSortedKeys.get(SUBSIZE);
View Full Code Here

    public void putAll(Map map) {
        if (map instanceof SortedMap) {
            SortedMap smap = (SortedMap)map;
            if (eq(this.comparator, smap.comparator())) {
                this.buildFromSorted(smap.entrySet().iterator(), map.size());
                return;
            }
        }
        // not a sorted map, or comparator mismatch
        super.putAll(map);
View Full Code Here

    }

    // Sort a and b so we can compare them.
    SortedMap sortedA = new TreeMap(comparator);
    sortedA.putAll(a);
    Iterator<Map.Entry> iterA = sortedA.entrySet().iterator();
    SortedMap sortedB = new TreeMap(comparator);
    sortedB.putAll(b);
    Iterator<Map.Entry> iterB = sortedB.entrySet().iterator();

    // Compare each item.
View Full Code Here

    SortedMap sortedA = new TreeMap(comparator);
    sortedA.putAll(a);
    Iterator<Map.Entry> iterA = sortedA.entrySet().iterator();
    SortedMap sortedB = new TreeMap(comparator);
    sortedB.putAll(b);
    Iterator<Map.Entry> iterB = sortedB.entrySet().iterator();

    // Compare each item.
    while (iterA.hasNext() && iterB.hasNext()) {
      Map.Entry entryA = iterA.next();
      Map.Entry entryB = iterB.next();
View Full Code Here

        // If we have found anything between the original start position and the size.
        if( sortedMap.size() > 0 )
        {
            final TreeMap toMerge = new TreeMap();
            final Iterator iterator = sortedMap.entrySet().iterator();

            while( iterator.hasNext() )
            {
                final Map.Entry entry = (Map.Entry)iterator.next();
View Full Code Here

      // Mark this node and all children as deleted
      workspace.addNode(workspaceNode); // deleted below
      SortedMap tailMap = workspace.getNodesAfter(workspaceNode.getFqn());

      for (Iterator it = tailMap.entrySet().iterator(); it.hasNext();)
      {
         WorkspaceNode toDelete = (WorkspaceNode) ((Map.Entry) it.next()).getValue();
         if (toDelete.getFqn().isChildOrEquals(nodeFqn))
         {
            if (debug) log.debug("marking node " + toDelete.getFqn() + " as deleted");
View Full Code Here

        // If we have found anything between the original start position and the size.
        if( sortedMap.size() > 0 )
        {
            final TreeMap toMerge = new TreeMap();
            final Iterator iterator = sortedMap.entrySet().iterator();

            while( iterator.hasNext() )
            {
                final Map.Entry entry = (Map.Entry)iterator.next();
View Full Code Here

      // Mark this node and all children as deleted
      workspace.addNode(workspaceNode); // deleted below
      SortedMap tailMap = workspace.getNodesAfter(workspaceNode.getFqn());

      for (Iterator it = tailMap.entrySet().iterator(); it.hasNext();)
      {
         WorkspaceNode toDelete = (WorkspaceNode) ((Map.Entry) it.next()).getValue();
         if (toDelete.getFqn().isChildOrEquals(nodeFqn))
         {
            if (debug) log.debug("marking node " + toDelete.getFqn() + " as deleted");
View Full Code Here

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.