Example usage for org.apache.commons.collections4.map LinkedMap get

List of usage examples for org.apache.commons.collections4.map LinkedMap get

Introduction

In this page you can find the example usage for org.apache.commons.collections4.map LinkedMap get.

Prototype

public K get(final int index) 

Source Link

Document

Gets the key at the specified index.

Usage

From source file:com.haulmont.cuba.gui.data.GroupInfo.java

public GroupInfo(LinkedMap groupingValues) {
    this.groupingValues = new LinkedMap(groupingValues);
    //noinspection unchecked
    groupProperty = (P) groupingValues.get(groupingValues.size() - 1);
}

From source file:com.t3.client.ui.T3Frame.java

private Timer newChatTimer() {
    // Set up the Chat timer to listen for changes
    Timer tm = new Timer(500, new ActionListener() {
        @Override//  w ww. jav a2  s. c  om
        public void actionPerformed(ActionEvent ae) {
            long currentTime = System.currentTimeMillis();
            LinkedMap<String, Long> chatTimers = chatTyperTimers.getChatTypers();
            List<String> removeThese = new ArrayList<String>(chatTimers.size());

            Set<String> playerTimers = chatTimers.keySet();
            for (String player : playerTimers) {
                if (currentTime - chatTimers.get(player) >= (chatNotifyDuration * 1000)) {
                    // set up a temp place and remove them after the loop
                    removeThese.add(player);
                }
            }
            for (String remove : removeThese) {
                chatTyperTimers.removeChatTyper(remove);
            }
        }
    });
    tm.start();
    return tm;
}

From source file:org.apache.wicket.MarkupContainer.java

/**
 * Removes the child component identified by {@code childId} from the list of children.
 * //ww  w  . j  a v  a  2 s .c o m
 * Will change the internal list or map to a single component when the number of children hits
 * 1, but not change the internal map to a list when the threshold is reached (the memory was
 * already claimed, so there's little to be gained other than wasting CPU cycles for the
 * conversion).
 * 
 * @param childId
 *            the id of the child component to remove
 */
private void children_remove(String childId) {
    if (children instanceof Component) {
        Component oldChild = children();
        if (oldChild.getId().equals(childId)) {
            children = null;
            removals_add(oldChild, null);
        }
    } else if (children instanceof List) {
        List<Component> childrenList = children();
        Iterator<Component> it = childrenList.iterator();
        Component prevChild = null;
        while (it.hasNext()) {
            Component child = it.next();
            if (child.getId().equals(childId)) {
                it.remove();
                removals_add(child, prevChild);
                if (childrenList.size() == 1) {
                    children = childrenList.get(0);
                }
                return;
            }
            prevChild = child;
        }
    } else if (children instanceof LinkedMap) {
        LinkedMap<String, Component> childrenMap = children();
        if (childrenMap.containsKey(childId)) {
            String prevSiblingId = childrenMap.previousKey(childId);
            Component oldChild = childrenMap.remove(childId);
            removals_add(oldChild, childrenMap.get(prevSiblingId));
            if (childrenMap.size() == 1) {
                children = childrenMap.values().iterator().next();
            }
        }
    }
}