org.apache.commons.collections

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache common Collections » org.apache.commons.collections 
org.apache.commons.collections

This package contains the interfaces and utilities shared across all the subpackages of this component.

The following collection implementations are provided in the package:

  • ArrayStack - a non synchronized Stack that follows the same API as java util Stack
  • ExtendedProperties - extends the Properties class to add extra functionality

Java Source File NameTypeComment
AbstractTestObject.javaClass Abstract test class for java.lang.Object methods and contracts.

To use, simply extend this class, and implement the AbstractTestObject.makeObject() method.

If your Object fails one of these tests by design, you may still use this base set of cases.

ArrayStack.javaClass An implementation of the java.util.Stack API that is based on an ArrayList instead of a Vector, so it is not synchronized to protect against multi-threaded access.
Bag.javaInterface Defines a collection that counts the number of times an object appears in the collection.
BagUtils.javaClass Provides utility methods and decorators for Bag and SortedBag instances.
BeanMap.javaClass An implementation of Map for JavaBeans which uses introspection to get and put properties in the bean.
BidiMap.javaInterface 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.

BinaryHeap.javaClass Binary heap implementation of PriorityQueue.

The PriorityQueue interface has now been replaced for most uses by the Buffer interface.

BoundedCollection.javaInterface Defines a collection that is bounded in size.

The size of the collection can vary, but it can never exceed a preset maximum number of elements.

BoundedFifoBuffer.javaClass The BoundedFifoBuffer is a very efficient implementation of Buffer that does not alter the size of the buffer at runtime.

The removal order of a BoundedFifoBuffer is based on the insertion order; elements are removed in the same order in which they were added.

BoundedMap.javaInterface Defines a map that is bounded in size.

The size of the map can vary, but it can never exceed a preset maximum number of elements.

Buffer.javaInterface Defines a collection that allows objects to be removed in some well-defined order.

The removal order can be based on insertion order (eg, a FIFO queue or a LIFO stack), on access order (eg, an LRU cache), on some arbitrary comparator (eg, a priority queue) or on any other well-defined ordering.

Note that the removal order is not necessarily the same as the iteration order.

BufferOverflowException.javaClass The BufferOverflowException is used when the buffer's capacity has been exceeded.
BufferUnderflowException.javaClass The BufferUnderflowException is used when the buffer is already empty.
BufferUtils.javaClass Provides utility methods and decorators for Buffer instances.
BulkTest.javaClass A TestCase that can define both simple and bulk test methods.

A simple test method is the type of test traditionally supplied by by TestCase .

Closure.javaInterface Defines a functor interface implemented by classes that do something.

A Closure represents a block of code which is executed from inside some block, function or iteration.

ClosureUtils.javaClass ClosureUtils provides reference implementations and utilities for the Closure functor interface.
CollectionUtils.javaClass Provides utility methods and decorators for Collection instances.
ComparatorUtils.javaClass Provides convenient static utility methods for Comparator objects.

Most of the functionality in this class can also be found in the comparators package.

CursorableLinkedList.javaClass A doubly-linked list implementation of the List interface, supporting a ListIterator that allows concurrent modifications to the underlying list.
DefaultMapBag.javaClass A skeletal implementation of the Bag interface to minimize the effort required for target implementations. Subclasses need only to call setMap(Map) in their constructor (or invoke the Map constructor) specifying a map instance that will be used to store the contents of the bag.

The map will be used to map bag elements to a number; the number represents the number of occurrences of that element in the bag.
since:
   Commons Collections 2.0
version:
   $Revision: 357494 $ $Date: 2005-12-18 19:05:31 +0000 (Sun, 18 Dec 2005) $
author:
   Chuck Burdick
author:
   Michael A.

DefaultMapEntry.javaClass A default implementation of java.util.Map.Entry
since:
   Commons Collections 1.0
version:
   $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
author:
   James Strachan
author:
   Michael A.
DoubleOrderedMap.javaClass Red-Black tree-based implementation of Map.
EnumerationUtils.javaClass Provides utility methods for Enumeration instances.
ExtendedProperties.javaClass This class extends normal Java properties by adding the possibility to use the same key many times concatenating the value strings instead of overwriting them.

Please consider using the PropertiesConfiguration class in Commons-Configuration as soon as it is released.

The Extended Properties syntax is explained here:

  • Each property has the syntax key = value
  • The key may use any character but the equal sign '='.
  • value may be separated on different lines if a backslash is placed at the end of the line that continues below.
  • If value is a list of strings, each token is separated by a comma ','.
  • Commas in each token are escaped placing a backslash right before the comma.
  • Backslashes are escaped by using two consecutive backslashes i.e.
Factory.javaInterface Defines a functor interface implemented by classes that create objects.

A Factory creates an object without using an input parameter. If an input parameter is required, then Transformer is more appropriate.

Standard implementations of common factories are provided by FactoryUtils .

FactoryUtils.javaClass FactoryUtils provides reference implementations and utilities for the Factory functor interface.
FastArrayList.javaClass

A customized implementation of java.util.ArrayList designed to operate in a multithreaded environment where the large majority of method calls are read-only, instead of structural changes.

FastHashMap.javaClass

A customized implementation of java.util.HashMap designed to operate in a multithreaded environment where the large majority of method calls are read-only, instead of structural changes.

FastTreeMap.javaClass

A customized implementation of java.util.TreeMap designed to operate in a multithreaded environment where the large majority of method calls are read-only, instead of structural changes.

FunctorException.javaClass Runtime exception thrown from functors.
HashBag.javaClass A Bag that is backed by a HashMap .
IterableMap.javaInterface Defines a map that can be iterated directly without needing to create an entry set.
IteratorUtils.javaClass Provides static utility methods and decorators for Iterator instances.
KeyValue.javaInterface Defines a simple key value pair.

A Map Entry has considerable additional semantics over and above a simple key-value pair.

ListUtils.javaClass Provides utility methods and decorators for List instances.
LocalTestNode.javaClass
LRUMap.javaClass

An implementation of a Map which has a maximum size and uses a Least Recently Used algorithm to remove items from the Map when the maximum size is reached and new items are added.

A synchronized version can be obtained with: Collections.synchronizedMap( theMapToSynchronize ) If it will be accessed by multiple threads, you _must_ synchronize access to this Map.

MapIterator.javaInterface Defines an iterator that operates over a Map.

This iterator is a special version designed for maps.

MapPerformance.javaClass TestMapPerformance is designed to perform basic Map performance tests.
MapUtils.javaClass Provides utility methods and decorators for Map and SortedMap instances.
MultiHashMap.javaClass MultiHashMap is the default implementation of the org.apache.commons.collections.MultiMap MultiMap interface.
MultiMap.javaInterface Defines a map that holds a collection of values against each key.
OrderedBidiMap.javaInterface Defines a map that allows bidirectional lookup between key and values and retains and provides access to an ordering.
OrderedIterator.javaInterface Defines an iterator that operates over an ordered collection.
OrderedMap.javaInterface Defines a map that maintains order and allows both forward and backward iteration through that order.
OrderedMapIterator.javaInterface Defines an iterator that operates over an ordered Map.
Predicate.javaInterface Defines a functor interface implemented by classes that perform a predicate test on an object.

A Predicate is the object equivalent of an if statement. It uses the input object to return a true or false value, and is often used in validation or filtering.

Standard implementations of common predicates are provided by PredicateUtils .

PredicateUtils.javaClass PredicateUtils provides reference implementations and utilities for the Predicate functor interface.
PriorityQueue.javaInterface Defines a collection for priority queues, which can insert, peek and pop.
ProxyMap.javaClass

This Map wraps another Map implementation, using the wrapped instance for its default implementation.

ReferenceMap.javaClass Hash-based 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.

ResettableIterator.javaInterface Defines an iterator that can be reset back to an initial state.
ResettableListIterator.javaInterface Defines a list iterator that can be reset back to an initial state.
SequencedHashMap.javaClass A map of objects whose mapping entries are sequenced based on the order in which they were added.
SetUtils.javaClass Provides utility methods and decorators for Set and SortedSet instances.
SortedBag.javaInterface Defines a type of Bag that maintains a sorted order among its unique representative members.
SortedBidiMap.javaInterface Defines a map that allows bidirectional lookup between key and values and retains both keys and values in sorted order.
StaticBucketMap.javaClass A StaticBucketMap is an efficient, thread-safe implementation of java.util.Map that performs well in in a highly thread-contentious environment.
SynchronizedPriorityQueue.javaClass A thread safe version of the PriorityQueue.
TestAll.javaClass Entry point for all Collections package tests.
TestAllPackages.javaClass Entry point for all Collections project tests.
TestArrayList.javaClass Abstract test class for ArrayList.
TestArrayStack.javaClass Tests ArrayStack.
TestBagUtils.javaClass Tests for BagUtils factory methods.
TestBeanMap.javaClass
TestBinaryHeap.javaClass Tests the BinaryHeap.
version:
   $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
author:
   Michael A.
TestBoundedFifoBuffer.javaClass Test cases for BoundedFifoBuffer.
TestBoundedFifoBuffer2.javaClass Runs tests against a full BoundedFifoBuffer, since many of the algorithms differ depending on whether the fifo is full or not.
TestBufferUtils.javaClass Tests for BufferUtils.
TestClosureUtils.javaClass Tests the org.apache.commons.collections.ClosureUtils class.
TestCollectionUtils.javaClass Tests for CollectionUtils.
TestCursorableLinkedList.javaClass Test class.
TestDoubleOrderedMap.javaClass Class TestDoubleOrderedMap

Test cases for DoubleOrderedMap.

TestEnumerationUtils.javaClass Tests EnumerationUtils.
TestExtendedProperties.javaClass Tests some basic functions of the ExtendedProperties class.
version:
   $Revision: 333060 $ $Date: 2005-11-13 16:59:51 +0000 (Sun, 13 Nov 2005) $
author:
   Geir Magnusson Jr.
author:
   Mohan Kishore
author:
   Stephen Colebourne
author:
   Shinobu Kawai
author:
   Henning P.
TestFactoryUtils.javaClass Tests the org.apache.commons.collections.FactoryUtils class.
TestFastArrayList.javaClass Test FastArrayList.
TestFastArrayList1.javaClass Test FastArrayList implementation in fast mode.
TestFastHashMap.javaClass Tests FastHashMap.
TestFastHashMap1.javaClass Test FastHashMap in fast mode.
TestFastTreeMap.javaClass Tests FastTreeMap.
TestFastTreeMap1.javaClass Test FastTreeMap in fast mode.
TestHashBag.javaClass Extension of TestBag for exercising the HashBag implementation.
TestIteratorUtils.javaClass Tests for IteratorUtils.
TestLinkedList.javaClass Tests base java.util.LinkedList methods and contracts.

To use, simply extend this class, and implement the TestLinkedList.makeLinkedList method.

If your LinkedList fails one of these tests by design, you may still use this base set of cases.

TestListUtils.javaClass Tests for ListUtils.
TestLRUMap.javaClass Tests LRUMap.
TestMapUtils.javaClass Tests for MapUtils.
TestMultiHashMap.javaClass Unit Tests for MultiHashMap.
TestPredicateUtils.javaClass Tests the org.apache.commons.collections.PredicateUtils class.
TestReferenceMap.javaClass Tests for ReferenceMap.
TestSequencedHashMap.javaClass Unit tests org.apache.commons.collections.SequencedHashMap . Be sure to use the "labRat" instance whenever possible, so that subclasses will be tested correctly.
version:
   $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
author:
   Morgan Delagrange
author:
   Daniel Rall
author:
   Henning P.
TestSetUtils.javaClass Tests for SetUtils.
TestStaticBucketMap.javaClass Unit tests. org.apache.commons.collections.StaticBucketMap .
version:
   $Revision: 348273 $ $Date: 2005-11-22 22:24:25 +0000 (Tue, 22 Nov 2005) $
author:
   Michael A.
TestTransformerUtils.javaClass Tests the org.apache.commons.collections.TransformerUtils class.
TestTreeBag.javaClass Extension of TestBag for exercising the TreeBag implementation.
TestTreeMap.javaClass Tests TreeMap.
TestTypedCollection.javaClass Tests TypedCollection.
TestUnboundedFifoBuffer.javaClass Test cases for UnboundedFifoBuffer.
Transformer.javaInterface Defines a functor interface implemented by classes that transform one object into another.

A Transformer converts the input object to the output object. The input object should be left unchanged. Transformers are typically used for type conversions, or extracting data from an object.

Standard implementations of common transformers are provided by TransformerUtils .

TransformerUtils.javaClass TransformerUtils provides reference implementations and utilities for the Transformer functor interface.
TreeBag.javaClass A Bag that is backed by a TreeMap .
UnboundedFifoBuffer.javaClass UnboundedFifoBuffer is a very efficient buffer implementation. According to performance testing, it exhibits a constant access time, but it also outperforms ArrayList when used for the same purpose.

The removal order of an UnboundedFifoBuffer is based on the insertion order; elements are removed in the same order in which they were added. The iteration order is the same as the removal order.

The UnboundedFifoBuffer.remove() and UnboundedFifoBuffer.get() operations perform in constant time. The UnboundedFifoBuffer.add(Object) operation performs in amortized constant time.

Unmodifiable.javaInterface Marker interface for collections, maps and iterators that are unmodifiable.

This interface enables testing such as:

 if (coll instanceof Unmodifiable) {
 coll = new ArrayList(coll);
 }
 // now we know coll is modifiable
 
Of course all this only works if you use the Unmodifiable classes defined in this library.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.