Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.collections.map: Javadoc index of package org.apache.commons.collections.map.


Package Samples:

org.apache.commons.collections.map

Classes:

AbstractTestMap: Abstract test class for java.util.Map methods and contracts. The forces at work here are similar to those in org.apache.commons.collections.collection.AbstractTestCollection . If your class implements the full Map interface, including optional operations, simply extend this class, and implement the makeEmptyMap() 55 method. On the other hand, if your map implementation is weird, you may have to override one or more of the other protected methods. They're described below. Entry Population Methods Override these methods if your map requires special entries: getSampleKeys() 55 getSampleValues() 55 ...
StaticBucketMap: A StaticBucketMap is an efficient, thread-safe implementation of java.util.Map that performs well in in a highly thread-contentious environment. The map supports very efficient get 55 , put 55 , remove 55 and containsKey 55 operations, assuming (approximate) uniform hashing and that the number of entries does not exceed the number of buckets. If the number of entries exceeds the number of buckets or if the hash codes of the objects are not uniformly distributed, these operations have a worst case scenario that is proportional to the number of elements in the map ( O(n) ). Each bucket in the hash ...
AbstractReferenceMap: An abstract implementation of a hash-based map that allows the entries to be removed by the garbage collector. This class implements all the features necessary for a subclass reference hash-based map. Key-value entries are stored in instances of the ReferenceEntry class which can be overridden and replaced. The iterators can similarly be replaced, without the need to replace the KeySet, EntrySet and Values view classes. Overridable methods are provided to change the default hashing behaviour, and to change how entries are added to and removed from the map. Hopefully, all you need for unusual subclasses ...
ReferenceMap: A Map implementation that allows mappings to be removed by the garbage collector. When you construct a ReferenceMap , you can specify what kind of references are used to store the map's keys and values. If non-hard references are used, then the garbage collector can remove mappings if a key or value becomes unreachable, or if the JVM's memory is running low. For information on how the different reference types behave, see Reference . Different types of references can be specified for keys and values. The keys can be configured to be weak but the values hard, in which case this class will behave ...
MultiKeyMap: A Map implementation that uses multiple keys to map the value. This class is the most efficient way to uses multiple keys to map to a value. The best way to use this class is via the additional map-style methods. These provide get , containsKey , put and remove for individual keys which operate without extra object creation. The additional methods are the main interface of this map. As such, you will not normally hold this map in a variable of type Map . The normal map methods take in and return a org.apache.commons.collections.keyvalue.MultiKey . If you try to use put() with any other object type ...
ReferenceIdentityMap: A Map implementation that allows mappings to be removed by the garbage collector and matches keys and values based on == not equals() . When you construct a ReferenceIdentityMap , you can specify what kind of references are used to store the map's keys and values. If non-hard references are used, then the garbage collector can remove mappings if a key or value becomes unreachable, or if the JVM's memory is running low. For information on how the different reference types behave, see java.lang.ref.Reference . Different types of references can be specified for keys and values. The default constructor ...
AbstractLinkedMap: An abstract implementation of a hash-based map that links entries to create an ordered map and which provides numerous points for subclasses to override. This class implements all the features necessary for a subclass linked hash-based map. Key-value entries are stored in instances of the LinkEntry class which can be overridden and replaced. The iterators can similarly be replaced, without the need to replace the KeySet, EntrySet and Values view classes. Overridable methods are provided to change the default hashing behaviour, and to change how entries are added to and removed from the map. Hopefully, ...
Flat3Map: A Map implementation that stores data in simple fields until the size is greater than 3. This map is designed for performance and can outstrip HashMap. It also has good garbage collection characteristics. Optimised for operation at size 3 or less. Still works well once size 3 exceeded. Gets at size 3 or less are about 0-10% faster than HashMap, Puts at size 3 or less are over 4 times faster than HashMap. Performance 5% slower than HashMap once size 3 exceeded once. The design uses two distinct modes of operation - flat and delegate. While the map is size 3 or less, operations map straight onto ...
LinkedMap: A Map implementation that maintains the order of the entries. In this implementation order is maintained by original insertion. This implementation improves on the JDK1.4 LinkedHashMap by adding the MapIterator functionality, additional convenience methods and allowing bidirectional iteration. It also implements OrderedMap . In addition, non-interface methods are provided to access the map by index. The orderedMapIterator() method provides direct access to a bidirectional iterator. The iterators from the other views can also be cast to OrderedIterator if required. All the available iterators can ...
SingletonMap: A Map implementation that holds a single item and is fixed size. The single key/value pair is specified at creation. The map is fixed size so any action that would change the size is disallowed. However, the put or setValue methods can change the value associated with the key. If trying to remove or clear the map, an UnsupportedOperationException is thrown. If trying to put a new mapping into the map, an IllegalArgumentException is thrown. The put method will only suceed if the key specified is the same as the singleton key. The key and value can be obtained by: normal Map methods and views the ...
AbstractMapDecorator: Provides a base decorator that enables additional functionality to be added to a Map via decoration. Methods are forwarded directly to the decorated map. This implementation does not perform any special processing with entrySet() 55 , keySet() 55 or values() 55 . Instead it simply returns the set/collection from the wrapped map. This may be undesirable, for example if you are trying to write a validating implementation it would provide a loophole around the validation. But, you might want that loophole, so this class is kept simple.
LazySortedMap: Decorates another SortedMap to create objects in the map on demand. When the LazyMap.get(Object) 55 method is called with a key that does not exist in the map, the factory is used to create the object. The created object will be added to the map using the requested key. For instance: Factory factory = new Factory() { public Object create() { return new Date(); } } SortedMap lazy = Lazy.sortedMap(new HashMap(), factory); Object obj = lazy.get("NOW"); After the above code is executed, obj will contain a new Date instance. Furthermore, that Date instance is mapped to the "NOW" key in the map. This ...
LazyMap: Decorates another Map to create objects in the map on demand. When the get(Object) 55 method is called with a key that does not exist in the map, the factory is used to create the object. The created object will be added to the map using the requested key. For instance: Factory factory = new Factory() { public Object create() { return new Date(); } } Map lazy = Lazy.map(new HashMap(), factory); Object obj = lazy.get("NOW"); After the above code is executed, obj will contain a new Date instance. Furthermore, that Date instance is mapped to the "NOW" key in the map. This class is Serializable from ...
CaseInsensitiveMap: A case-insensitive Map . As entries are added to the map, keys are converted to all lowercase. A new key is compared to existing keys by comparing newKey.toString().toLower() to the lowercase values in the current KeySet. Null keys are supported. The keySet() method returns all lowercase keys, or nulls. Example: Map map = new CaseInsensitiveMap(); map.put("One", "One"); map.put("Two", "Two"); map.put(null, "Three"); map.put("one", "Four"); creates a CaseInsensitiveMap with three entries. map.get(null) returns "Three" and map.get("ONE") returns "Four". The Set returned by keySet() equals {"one", ...
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 ...
AbstractHashedMap: An abstract implementation of a hash-based map which provides numerous points for subclasses to override. This class implements all the features necessary for a subclass hash-based map. Key-value entries are stored in instances of the HashEntry class, which can be overridden and replaced. The iterators can similarly be replaced, without the need to replace the KeySet, EntrySet and Values view classes. Overridable methods are provided to change the default hashing behaviour, and to change how entries are added to and removed from the map. Hopefully, all you need for unusual subclasses is here. NOTE: ...
ListOrderedMap: Decorates a Map to ensure that the order of addition is retained using a List to maintain order. The order will be used via the iterators and toArray methods on the views. The order is also returned by the MapIterator . The orderedMapIterator() method accesses an iterator that can iterate both forwards and backwards through the map. In addition, non-interface methods are provided to access the map by index. If an object is added to the Map for a second time, it will remain in the original position in the iteration. This class is Serializable from Commons Collections 3.1.
AbstractInputCheckedMapDecorator: An abstract base class that simplifies the task of creating map decorators. The Map API is very difficult to decorate correctly, and involves implementing lots of different classes. This class exists to provide a simpler API. Special hook methods are provided that are called when objects are added to the map. By overriding these methods, the input can be validated or manipulated. In addition to the main map methods, the entrySet is also affected, which is the hardest part of writing map implementations. This class is package-scoped, and may be withdrawn or replaced in future versions of Commons ...
FixedSizeSortedMap: Decorates another SortedMap to fix the size blocking add/remove. Any action that would change the size of the map is disallowed. The put method is allowed to change the value associated with an existing key however. If trying to remove or clear the map, an UnsupportedOperationException is thrown. If trying to put a new mapping into the map, an IllegalArgumentException is thrown. This is because the put method can succeed if the mapping's key already exists in the map, so the put method is not always unsupported. This class is Serializable from Commons Collections 3.1.
FixedSizeMap: Decorates another Map to fix the size, preventing add/remove. Any action that would change the size of the map is disallowed. The put method is allowed to change the value associated with an existing key however. If trying to remove or clear the map, an UnsupportedOperationException is thrown. If trying to put a new mapping into the map, an IllegalArgumentException is thrown. This is because the put method can succeed if the mapping's key already exists in the map, so the put method is not always unsupported. This class is Serializable from Commons Collections 3.1.
PredicatedSortedMap: Decorates another SortedMap to validate that additions match a specified predicate. This map exists to provide validation for the decorated map. It is normally created to decorate an empty map. If an object cannot be added to the map, an IllegalArgumentException is thrown. One usage would be to ensure that no null keys are added to the map. SortedMap map = PredicatedSortedSet.decorate(new TreeMap(), NotNullPredicate.INSTANCE, null); This class is Serializable from Commons Collections 3.1.
AbstractOrderedMapDecorator: Provides a base decorator that enables additional functionality to be added to an OrderedMap via decoration. Methods are forwarded directly to the decorated map. This implementation does not perform any special processing with the map views. Instead it simply returns the set/collection from the wrapped map. This may be undesirable, for example if you are trying to write a validating implementation it would provide a loophole around the validation. But, you might want that loophole, so this class is kept simple.
AbstractSortedMapDecorator: Provides a base decorator that enables additional functionality to be added to a Map via decoration. Methods are forwarded directly to the decorated map. This implementation does not perform any special processing with the map views. Instead it simply returns the set/collection from the wrapped map. This may be undesirable, for example if you are trying to write a validating implementation it would provide a loophole around the validation. But, you might want that loophole, so this class is kept simple.
PredicatedMap: Decorates another Map to validate that additions match a specified predicate. This map exists to provide validation for the decorated map. It is normally created to decorate an empty map. If an object cannot be added to the map, an IllegalArgumentException is thrown. One usage would be to ensure that no null keys are added to the map. Map map = PredicatedSet.decorate(new HashMap(), NotNullPredicate.INSTANCE, null); This class is Serializable from Commons Collections 3.1.
TransformedSortedMap: Decorates another SortedMap to transform objects that are added. The Map put methods and Map.Entry setValue method are affected by this class. Thus objects must be removed or searched for using their transformed form. For example, if the transformation converts Strings to Integers, you must use the Integer form to remove objects. This class is Serializable from Commons Collections 3.1.

Home | Contact Us | Privacy Policy | Terms of Service