本文整理汇总了Java中javolution.util.FastMap.put方法的典型用法代码示例。如果您正苦于以下问题:Java FastMap.put方法的具体用法?Java FastMap.put怎么用?Java FastMap.put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javolution.util.FastMap
的用法示例。
在下文中一共展示了FastMap.put方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPackingSessionLinesByPackage
import javolution.util.FastMap; //导入方法依赖的package包/类
/**
* <p>Delivers all the packing lines grouped by package.</p>
* <p>Output map:
* <ul>
* <li>packageMap - a Map of type Map<Integer, List<PackingSessionLine>>
* that maps package sequence ids to the lines that belong in
* that package</li>
* <li>sortedKeys - a List of type List<Integer> with the sorted package
* sequence numbers to index the packageMap</li>
* @return result Map with packageMap and sortedKeys
*/
public Map<Object, Object> getPackingSessionLinesByPackage() {
FastMap<Integer, List<PackingSessionLine>> packageMap = FastMap.newInstance();
for (PackingSessionLine line : packLines) {
int pSeq = line.getPackageSeq();
List<PackingSessionLine> packageLineList = packageMap.get(pSeq);
if (packageLineList == null) {
packageLineList = FastList.newInstance();
packageMap.put(pSeq, packageLineList);
}
packageLineList.add(line);
}
Object[] keys = packageMap.keySet().toArray();
java.util.Arrays.sort(keys);
List<Object> sortedKeys = FastList.newInstance();
for (Object key : keys) {
sortedKeys.add(key);
}
Map<Object, Object> result = FastMap.newInstance();
result.put("packageMap", packageMap);
result.put("sortedKeys", sortedKeys);
return result;
}