Bag:
Defines a collection that counts the number of times an object appears in the collection.
Suppose you have a Bag that contains {a, a, b, c}. Calling getCount(Object) on a would return 2, while calling uniqueSet() would return {a, b, c}.
BidiMap:
Defines a map that allows bidirectional lookup between key and values.
This extended Map represents a mapping where a key may lookup a value and a value may lookup a key with equal ease. This interface extends Map and so may be used anywhere a map is required. The interface provides an inverse map view, enabling full access to both directions of the BidiMap.
LRUMap:
A Map implementation with a fixed maximum size which removes the least recently used entry if an entry is added when full.
The least recently used algorithm works on the get and put operations only. Iteration of any kind, including setting the value by iteration, does not change the order. Queries such as containsKey and containsValue or access via views also do not change the order.
The map implements OrderedMap and entries may be queried using the bidirectional OrderedMapIterator. The order returned is least recently used to most recently used. Iterators from map views can also be cast to OrderedIterator if required.
All the available iterators can be reset back to the start by casting to ResettableIterator and calling reset().
commons-collections 学习笔记
最新推荐文章于 2024-04-15 17:06:31 发布
本文详细介绍了三种集合类型:Bag,一种可以记录元素出现次数的集合;BidiMap,一种支持键值双向查找的映射;LRUMap,一种具有固定大小并采用最近最少使用淘汰策略的映射。
406

被折叠的 条评论
为什么被折叠?



