List of usage examples for org.apache.commons.collections4.keyvalue MultiKey getKey
public K getKey(final int index)
From source file:femr.util.DataStructure.Mapping.TabFieldMultiMap.java
/** * Checks to see if the map contains an entry for a field * * @param fieldName name of the field//from ww w. j a v a 2 s.c om * @return true if the field has an entry, false otherwise */ public boolean containsTabField(String fieldName) { MapIterator multiMapIterator = this.getMultiMapIterator(); while (multiMapIterator.hasNext()) { multiMapIterator.next(); MultiKey mk = (MultiKey) multiMapIterator.getKey(); if (mk.getKey(0) != null) { if (fieldName.equals(mk.getKey(0))) { return true; } } } return false; }
From source file:femr.util.DataStructure.Mapping.TabFieldMultiMap.java
/** * Checks to see if the map contains any entries for a field * * @param fieldName name of the field * @param chiefComplaint chiefcomplaint that it belongs to (can be null) * @return true if the field has an entry, false otherwise *///from w ww . ja v a 2 s . co m public boolean containsTabField(String fieldName, String chiefComplaint) { MapIterator multiMapIterator = this.getMultiMapIterator(); while (multiMapIterator.hasNext()) { multiMapIterator.next(); MultiKey mk = (MultiKey) multiMapIterator.getKey(); if (mk.getKey(0) != null && mk.getKey(2) != null) { if (fieldName.equals(mk.getKey(0)) && chiefComplaint.equals(mk.getKey(2))) { return true; } } } return false; }
From source file:org.apache.openmeetings.web.app.Application.java
public static boolean isUserOnline(Long userId) { MapIterator<MultiKey<? extends String>, org.apache.openmeetings.web.app.Client> it = ONLINE_USERS .mapIterator();/*from w w w. j a va 2 s. co m*/ boolean isUserOnline = false; while (it.hasNext()) { MultiKey<? extends String> multi = it.next(); if (multi.size() > 0 && userId.equals(multi.getKey(0))) { isUserOnline = true; break; } } return isUserOnline; }
From source file:org.apache.openmeetings.web.app.Application.java
public static List<org.apache.openmeetings.web.app.Client> getClients(Long userId) { List<org.apache.openmeetings.web.app.Client> result = new ArrayList<org.apache.openmeetings.web.app.Client>(); MapIterator<MultiKey<? extends String>, org.apache.openmeetings.web.app.Client> it = ONLINE_USERS .mapIterator();//from w w w .j a v a2s. c om while (it.hasNext()) { MultiKey<? extends String> multi = it.next(); if (multi.size() > 1 && userId.equals(multi.getKey(0))) { result.add(getClientByKeys(userId, (String) (multi.getKey(1)))); break; } } return result; }