List of usage examples for org.apache.commons.collections.map LinkedMap LinkedMap
public LinkedMap(Map map)
From source file:com.poloure.simplerss.adapters.LinkedMapAdapter.java
LinkedMapAdapter(Map<K, V> map) {
m_map = null == map ? new LinkedMap(1) : new LinkedMap(map);
notifyDataSetChanged();
}
From source file:com.tilab.ca.sse.core.classify.Classifier.java
private List<ScoreDoc> sortByRank(Map<ScoreDoc, Integer> inputList) { LOG.debug("[sortByRank] - BEGIN"); List<ScoreDoc> result = new ArrayList<>(); LinkedMap apacheMap = new LinkedMap(inputList); for (int i = 0; i < apacheMap.size() - 1; i++) { Map<Float, ScoreDoc> treeMap = new TreeMap<>(Collections.reverseOrder()); do {//from w ww .j ava 2s . c om i++; treeMap.put(((ScoreDoc) apacheMap.get(i - 1)).score, (ScoreDoc) apacheMap.get(i - 1)); } while (i < apacheMap.size() && apacheMap.getValue(i) == apacheMap.getValue(i - 1)); i--; treeMap.keySet().stream().forEach((score) -> { result.add(treeMap.get(score)); }); } LOG.debug("[sortByRank] - END"); return result; }
From source file:it.polito.tellmefirst.web.rest.clients.ClientEpub.java
public ArrayList<ClassifyOutput> sortByRank(HashMap<ClassifyOutput, Integer> inputList) { LOG.debug("[sortByRank] - BEGIN"); ArrayList<ClassifyOutput> result = new ArrayList<>(); LinkedMap apacheMap = new LinkedMap(inputList); for (int i = 0; i < apacheMap.size() - 1; i++) { TreeMap<Float, ClassifyOutput> treeMap = new TreeMap<>(Collections.reverseOrder()); do {//from ww w . j a v a 2s . c o m i++; treeMap.put(Float.valueOf(((ClassifyOutput) apacheMap.get(i - 1)).getScore()), (ClassifyOutput) apacheMap.get(i - 1)); } while (i < apacheMap.size() && apacheMap.getValue(i) == apacheMap.getValue(i - 1)); i--; for (Float score : treeMap.keySet()) { result.add(treeMap.get(score)); } } LOG.debug("[sortByRank] - END"); return result; }
From source file:org.apache.cocoon.portal.layout.AbstractLayout.java
protected Object clone() throws CloneNotSupportedException { AbstractLayout clone = (AbstractLayout) super.clone(); // we don't clone the parent; we just set it to null clone.rendererName = this.rendererName; clone.parameters = new LinkedMap(this.parameters); clone.parent = null;// w w w . j a v a 2 s . co m return clone; }
From source file:org.apache.cocoon.portal.layout.AbstractParameters.java
protected Object clone() throws CloneNotSupportedException { AbstractParameters clone = (AbstractParameters) super.clone(); clone.parameters = new LinkedMap(this.parameters); return clone; }
From source file:org.apache.cocoon.portal.profile.impl.SiteProfileManager.java
protected Map buildKey(String category, String profileType, UserInfo info, boolean load) { final StringBuffer config = new StringBuffer(profileType); config.append('-'); config.append(category);/* w w w . ja va 2s. c o m*/ config.append('-'); if (load) { config.append("load"); } else { config.append("save"); } final String uri = (String) info.getConfigurations().get(config.toString()); final Map key = new LinkedMap(6); key.put("baseuri", uri); key.put("separator", "?"); key.put("portal", info.getPortalName()); key.put("layout", info.getLayoutKey()); key.put("type", category); key.put("site", this.getSiteName()); return key; }
From source file:org.apache.cocoon.selection.XPathExceptionSelector.java
public void configure(Configuration conf) throws ConfigurationException { super.configure(conf); Configuration[] children = conf.getChildren("exception"); Configuration[] xPathChildren; for (int i = 0; i < children.length; i++) { // Check if there are XPath-Expressions configured xPathChildren = children[i].getChildren("xpath"); Map xPathMap = new LinkedMap(11); for (int j = 0; j < xPathChildren.length; j++) { Configuration xPathChild = xPathChildren[j]; String xPathName = xPathChild.getAttribute("name"); CompiledExpression xPath = JXPathContext.compile(xPathChild.getAttribute("test")); xPathMap.put(xPathName, xPath); }/*w ww .ja v a 2 s .c o m*/ if (xPathMap.size() > 0) { // store xpath - config if there is some exception2XPath.put(children[i].getAttribute("name", null), xPathMap); } } }
From source file:org.apache.jackrabbit.spi.commons.ItemInfoCacheImpl.java
/** * Create a new instance with a given cache size. * @param cacheSize//from w w w . j a va 2s. c om */ public ItemInfoCacheImpl(int cacheSize) { super(); this.cacheSize = cacheSize; entries = new LinkedMap(cacheSize); }
From source file:org.araneaframework.core.StandardComponent.java
/** * Returns a unmodifiable map of all the child components under this Component. * @return a map of child components// w ww . j av a 2 s .c o m */ public Map getChildren() { return Collections.unmodifiableMap(new LinkedMap(_getChildren())); }
From source file:org.araneaframework.uilib.form.FormWidget.java
/** * Returns elements. * @return elements. */ public Map getElements() { return new LinkedMap(elements); }