Package org.apache.commons.collections

Examples of org.apache.commons.collections.OrderedMapIterator


    public void testMapIteratorOrder() {
        if (supportsFullIterator() == false) {
            return;
        }

        OrderedMapIterator it = makeFullOrderedMapIterator();
        Map map = getMap();
       
        assertEquals("keySet() not consistent", new ArrayList(map.keySet()), new ArrayList(map.keySet()));
       
        Iterator it2 = map.keySet().iterator();
        assertEquals(true, it.hasNext());
        assertEquals(true, it2.hasNext());
        List list = new ArrayList();
        while (it.hasNext()) {
            Object key = it.next();
            assertEquals(it2.next(), key);
            list.add(key);
        }
        assertEquals(map.size(), list.size());
        while (it.hasPrevious()) {
            Object key = it.previous();
            assertEquals(list.get(list.size() - 1), key);
            list.remove(list.size() - 1);
        }
        assertEquals(0, list.size());
    }
View Full Code Here


    public void initScope(Context context, Scriptable scope) {
        for (ButterflyModule m : _dependencies.values()) {
            m.initScope(context, scope);
        }
       
        OrderedMapIterator i = _scripts.orderedMapIterator();
        while (i.hasNext()) {
            URL url = (URL) i.next();
            _logger.debug("Executing script: {}", url);
            Script s = (Script) _scripts.get(url);
            s.exec(context, scope);
        }
    }
View Full Code Here

            haveFromTable = true;
            logger.debug("From table defined by a where clause");
        }

        ListOrderedMapCI cMap = getAggregates();
        OrderedMapIterator iMap = cMap.orderedMapIterator();
        while (iMap.hasNext())
        {
            String key = (String) iMap.next();
            SQLFunction f = (SQLFunction) iMap.getValue();
            Column col =  f.getColumn();
            c.addAsColumn(key, new ColumnImpl(
                    null,
                    col.getTableName(),
                    col.getColumnName(),
View Full Code Here

            haveFromTable = true;
            logger.debug("From table defined by a where clause");
        }

        ListOrderedMapCI cMap = getAggregates();
        OrderedMapIterator iMap = cMap.orderedMapIterator();
        while (iMap.hasNext())
        {
            String key = (String) iMap.next();
            SQLFunction f = (SQLFunction) iMap.getValue();
            Column col =  f.getColumn();
            c.addAsColumn(key, new ColumnImpl(
                    null,
                    col.getTableName(),
                    col.getColumnName(),
View Full Code Here

        boolean first = includeHeader;

        while (i.hasNext())
        {
            ListOrderedMapCI rec = (ListOrderedMapCI) i.next();
            OrderedMapIterator rI = rec.orderedMapIterator();
            StringBuilder heading = new StringBuilder();
            StringBuilder recString = new StringBuilder();
            while (rI.hasNext())
            {
                String colId = (String) rI.next();
                if (first)
                {
                    heading.append("\"").append(colId).append("\"");
                    if (rI.hasNext())
                    {
                        heading.append(", ");
                    }
                }
                Object v = rI.getValue();
                recString.append(v.toString());
                if (rI.hasNext())
                {
                    recString.append(", ");
                }
            }
            if (first)
View Full Code Here

        return inverseOrderedBidiMap();
    }
   
    //-----------------------------------------------------------------------
    public OrderedMapIterator orderedMapIterator() {
        OrderedMapIterator it = getOrderedBidiMap().orderedMapIterator();
        return UnmodifiableOrderedMapIterator.decorate(it);
    }
View Full Code Here

        return inverseSortedBidiMap();
    }
   
    //-----------------------------------------------------------------------
    public OrderedMapIterator orderedMapIterator() {
        OrderedMapIterator it = getSortedBidiMap().orderedMapIterator();
        return UnmodifiableOrderedMapIterator.decorate(it);
    }
View Full Code Here

        MapIterator it = getOrderedMap().mapIterator();
        return UnmodifiableMapIterator.decorate(it);
    }

    public OrderedMapIterator orderedMapIterator() {
        OrderedMapIterator it = getOrderedMap().orderedMapIterator();
        return UnmodifiableOrderedMapIterator.decorate(it);
    }
View Full Code Here

/* 104 */     MapIterator it = getOrderedMap().mapIterator();
/* 105 */     return UnmodifiableMapIterator.decorate(it);
/*     */   }
/*     */
/*     */   public OrderedMapIterator orderedMapIterator() {
/* 109 */     OrderedMapIterator it = getOrderedMap().orderedMapIterator();
/* 110 */     return UnmodifiableOrderedMapIterator.decorate(it);
/*     */   }
View Full Code Here

/* 115 */     return inverseOrderedBidiMap();
/*     */   }
/*     */
/*     */   public OrderedMapIterator orderedMapIterator()
/*     */   {
/* 120 */     OrderedMapIterator it = getOrderedBidiMap().orderedMapIterator();
/* 121 */     return UnmodifiableOrderedMapIterator.decorate(it);
/*     */   }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.OrderedMapIterator

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.