Examples of DualHashBidiMap


Examples of org.apache.commons.collections.bidimap.DualHashBidiMap

    public TestUnmodifiableMapIterator(String testName) {
        super(testName);
    }

    public MapIterator makeEmptyMapIterator() {
        return UnmodifiableMapIterator.decorate(new DualHashBidiMap().mapIterator());
    }
View Full Code Here

Examples of org.apache.commons.collections.bidimap.DualHashBidiMap

    public MapIterator makeFullMapIterator() {
        return UnmodifiableMapIterator.decorate(((BidiMap) getMap()).mapIterator());
    }
   
    public Map getMap() {
        Map testMap = new DualHashBidiMap();
        testMap.put("A", "a");
        testMap.put("B", "b");
        testMap.put("C", "c");
        return testMap;
    }
View Full Code Here

Examples of org.apache.commons.collections.bidimap.DualHashBidiMap

     * @return A List of column id:s
     */
    public static List<Integer> getColumnIds( String columnNames, Map<String,Integer> allColumns,
                                              Map<String,Integer> deprecatedColumns, Log log )
    {
        DualHashBidiMap bidiColumns = null;
        List<Integer> columnIds = new ArrayList<Integer>();
        String[] columnNamesArray = columnNames.split( "," );

        if ( deprecatedColumns != null )
        {
            bidiColumns = new DualHashBidiMap( allColumns );
        }

        // Loop through the names of the columns, to validate each of them and add their id to the list
        for ( int i = 0; i < columnNamesArray.length; i++ )
        {
            String columnName = columnNamesArray[i].trim();
            if ( allColumns.containsKey( columnName ) )
            {
                columnIds.add( allColumns.get( columnName ) );
            }
            else if ( deprecatedColumns != null && deprecatedColumns.containsKey( columnName ) )
            {
                Integer columnId = deprecatedColumns.get( columnName );
                columnIds.add( columnId );
                if ( log != null )
                {
                    log.warn( "The columnName '" + columnName + "' has been deprecated." + " Please use "
                        + "the columnName '" + bidiColumns.getKey( columnId ) + "' instead." );
                }
            }
        }
        return columnIds;
    }
View Full Code Here

Examples of org.apache.commons.collections.bidimap.DualHashBidiMap

    public MapIterator makeFullMapIterator() {
        return UnmodifiableMapIterator.decorate(((BidiMap) getMap()).mapIterator());
    }
   
    public Map getMap() {
        Map testMap = new DualHashBidiMap();
        testMap.put("A", "a");
        testMap.put("B", "b");
        testMap.put("C", "c");
        return testMap;
    }
View Full Code Here

Examples of org.apache.commons.collections.bidimap.DualHashBidiMap

    public TestUnmodifiableMapIterator(String testName) {
        super(testName);
    }

    public MapIterator makeEmptyMapIterator() {
        return UnmodifiableMapIterator.decorate(new DualHashBidiMap().mapIterator());
    }
View Full Code Here

Examples of org.apache.commons.collections.bidimap.DualHashBidiMap

     * @return A List of column id:s
     */
    public static List<Integer> getColumnIds( String columnNames, Map<String,Integer> allColumns,
                                              Map<String,Integer> deprecatedColumns, Log log )
    {
        DualHashBidiMap bidiColumns = null;
        List<Integer> columnIds = new ArrayList<Integer>();
        String[] columnNamesArray = columnNames.split( "," );

        if ( deprecatedColumns != null )
        {
            bidiColumns = new DualHashBidiMap( allColumns );
        }

        // Loop through the names of the columns, to validate each of them and add their id to the list
        for ( int i = 0; i < columnNamesArray.length; i++ )
        {
            String columnName = columnNamesArray[i].trim();
            if ( allColumns.containsKey( columnName ) )
            {
                columnIds.add( allColumns.get( columnName ) );
            }
            else if ( deprecatedColumns != null && deprecatedColumns.containsKey( columnName ) )
            {
                Integer columnId = deprecatedColumns.get( columnName );
                columnIds.add( columnId );
                if ( log != null )
                {
                    log.warn( "The columnName '" + columnName + "' has been deprecated." + " Please use "
                        + "the columnName '" + bidiColumns.getKey( columnId ) + "' instead." );
                }
            }
        }
        return columnIds;
    }
View Full Code Here

Examples of org.apache.commons.collections.bidimap.DualHashBidiMap

    public TestUnmodifiableMapIterator(String testName) {
        super(testName);
    }

    public MapIterator makeEmptyMapIterator() {
        return UnmodifiableMapIterator.decorate(new DualHashBidiMap().mapIterator());
    }
View Full Code Here

Examples of org.apache.commons.collections.bidimap.DualHashBidiMap

    public MapIterator makeFullMapIterator() {
        return UnmodifiableMapIterator.decorate(((BidiMap) getMap()).mapIterator());
    }
   
    public Map getMap() {
        Map testMap = new DualHashBidiMap();
        testMap.put("A", "a");
        testMap.put("B", "b");
        testMap.put("C", "c");
        return testMap;
    }
View Full Code Here

Examples of org.apache.commons.collections.bidimap.DualHashBidiMap

     * @return A List of column id:s
     */
    public static List<Integer> getColumnIds( String columnNames, Map<String, Integer> allColumns,
                                              Map<String, Integer> deprecatedColumns, Log log )
    {
        DualHashBidiMap bidiColumns = null;
        List<Integer> columnIds = new ArrayList<Integer>();
        String[] columnNamesArray = columnNames.split( "," );

        if ( deprecatedColumns != null )
        {
            bidiColumns = new DualHashBidiMap( allColumns );
        }

        // Loop through the names of the columns, to validate each of them and add their id to the list
        for ( String aColumnNamesArray : columnNamesArray )
        {
            String columnName = aColumnNamesArray.trim();
            if ( allColumns.containsKey( columnName ) )
            {
                columnIds.add( allColumns.get( columnName ) );
            }
            else if ( deprecatedColumns != null && deprecatedColumns.containsKey( columnName ) )
            {
                Integer columnId = deprecatedColumns.get( columnName );
                columnIds.add( columnId );
                if ( log != null )
                {
                    log.warn( "The columnName '" + columnName + "' has been deprecated." + " Please use "
                            + "the columnName '" + bidiColumns.getKey( columnId ) + "' instead." );
                }
            }
        }
        return columnIds;
    }
View Full Code Here

Examples of org.apache.commons.collections.bidimap.DualHashBidiMap

        return clientConfiguredName;
    }

    private BidiMap mapConfiguredToRegisteredClientNames(List<String> configuredClientNamesForTest, ClientRegistry clientRegistry)
    {
        BidiMap configuredToRegisteredNameMap = new DualHashBidiMap();

        TreeSet<String> registeredClients = new TreeSet<String>(clientRegistry.getClients());
        for (String configuredClientName : configuredClientNamesForTest)
        {
            String allocatedClientName = registeredClients.pollFirst();
            if (allocatedClientName == null)
            {
                throw new IllegalArgumentException("Too few clients in registry " + clientRegistry + " configured clients " + configuredClientNamesForTest);
            }
            configuredToRegisteredNameMap.put(configuredClientName, allocatedClientName);
        }

        return configuredToRegisteredNameMap;
    }
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.