commons-collections4-4.0-src/default.properties 100664 5465 12243235515 17770 0 ustar tn tn 0 0 #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# $Id: default.properties 1495867 2013-06-23 18:27:46Z tn $
# The location of the "junit.jar" JAR file
junit.jar = ${junit.home}/junit-4.11.jar
# The location of the "junit.jar" JAR file
hamcrest.jar = ${hamcrest.home}/hamcrest-core-1.3.jar
# The location of the Easymock jar
easymock.jar = ${easymock.home}/easymock-3.1.jar
# Whether or not to fork tests
junit.fork = true
# The name of this component
component.name = commons-collections4
# The primary package name of this component
component.package = org.apache.commons.collections4
# The title of this component
component.title = Commons Collections
# The current version number of this component
component.version = 4.0-SNAPSHOT
# The name that is used to create the jar file
final.name = ${component.name}-${component.version}
# The base directory for compilation targets
build.home = target
# The base directory for component configuration files
conf.home = src/conf
# The base directory for component sources
source.home = src/main/java
# The base directory for unit test sources
test.home = src/test/java
# Should Java compilations set the 'debug' compiler option?
compile.debug = true
# Should Java compilations set the 'deprecation' compiler option?
compile.deprecation = true
# Should Java compilations set the 'optimize' compiler option?
compile.optimize = true
# Generate class files for specific VM version (e.g., 1.1 or 1.2).
# Note that the default value depends on the JVM that is running Ant.
# In particular, if you use JDK 1.4+ the generated classes will not be usable
# for a 1.1 Java VM unless you explicitly set this attribute to the value 1.1
# (which is the default value for JDK 1.1 to 1.3).
compile.target = 1.5
# Specifies the source version for the Java compiler.
# Corresponds to the source attribute for the ant javac task.
# Valid values are 1.3, 1.4, 1.5.
compile.source = 1.5
# Specifies the source encoding.
compile.encoding = ISO-8859-1
# Should all tests fail if one does?
test.failonerror = true
# The test runner to execute
test.runner = junit.textui.TestRunner
commons-collections4-4.0-src/build.properties.sample 100664 2640 12243235517 20715 0 ustar tn tn 0 0 # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
# Sample Ant build.properties file
#
# This setup assumes dependent jars are in a local maven 2 repository.
# However the jars are located, the properties ending in ".jar" need
# expand to full paths to the jars.
##########################################################################
# Repository base path - unnecessary if full jar paths are provided below
repository=${user.home}/.m2/repository
junit.home=${repository}/junit/junit/4.11/
hamcrest.home=${repository}/org/hamcrest/hamcrest-core/1.3/
easymock.home=${repository}/org/easymock/easymock/3.2/
commons-collections4-4.0-src/PROPOSAL.html 100664 7343 12243235515 16350 0 ustar tn tn 0 0
Proposal for Collections Package
Proposal for Collections Package
(0) Rationale
The Java Collections Framework provides a set of abstract data
type interfaces and implementations that offer both a wealth
of useful functionality, and a solid foundation for extending
that functionality.
Many Jakarta projects have needs or design criteria that extend
beyond the core Collections API, such as introducing new abstract
data types (e.g., Avalon's BinaryHeap) or changing the behaviour of
existing abstract data types (e.g., Struts' FastHashMap).
In keeping with the spirit of the Collections API and of abstract
data types in general, these components can and should be shared
assets. A Commons package for abstract data types would
encourage the development and reuse of a robust set of collections
classes.
(1) Scope of the Package
The package will create and maintain a set of collections and
related classes designed to be compatible with the Java Collections
Framework, and to be distributed under the ASF license.
(1.5) Interaction With Other Packages
Collections relies only on standard JDK 1.2 (or later) APIs for
production deployment. It utilizes the JUnit unit testing framework for
developing and executing unit tests, but this is of interest only to
developers of the component. Collections will also be a dependency for
several future proposed components for the Jakarta Commons subproject.
No external configuration files are utilized.
(2) Initial Source of the Package
The initial codebase was harvested from existing and proposed
Jakarta packages, including the Commons Database Connection Pool,
Struts, and Avalon.
The proposed package name for the new component is
org.apache.commons.collections.
(3) Required Jakarta-Commons Resources
CVS Repository - New directory collections in the
jakarta-commons CVS repository. All initial committers
are already committers on jakarta-commons, so no
additional user setups are required.
Mailing List - Discussions will take place on the general
jakarta-commons@jakarta.apache.org mailing list. To help
list subscribers identify messages of interest, it is suggested that
the message subject of messages about this component be prefixed with
[Collections].
Bugzilla - New component "Collections" under the "Commons" product
category, with appropriate version identifiers as needed.
Jyve FAQ - New category "commons-collections" (when available).
(4) Initial Committers
Peter Donald
Craig McClanahan
Rodney Waldhoff
James Strachan
commons-collections4-4.0-src/pom.xml 100664 47302 12243235517 15561 0 ustar tn tn 0 0
org.apache.commonscommons-parent324.0.0org.apache.commonscommons-collections44.0Apache Commons Collections2001The Apache Commons Collections package contains types that extend and augment the Java Collections Framework.http://commons.apache.org/proper/commons-collections/jirahttp://issues.apache.org/jira/browse/COLLECTIONSscm:svn:http://svn.apache.org/repos/asf/commons/proper/collections/trunkscm:svn:https://svn.apache.org/repos/asf/commons/proper/collections/trunkhttp://svn.apache.org/viewvc/commons/proper/collections/trunkMatt BensonmbensonJames CarmanjcarmanStephen ColebournescolebourneRobert Burrell DonkinrdonkinMorgan DelagrangemorgandGary D. GregoryggregoryMatthew HawthornematthGeir MagnussongeirmLuc MaisonobelucCraig McClanahancraigmccAdrian NistoradriannistorPhil SteitzpsteitzArun M. ThomasamammentRodney WaldhoffrwaldhoffHenri YandellbayardThomas NeidharttnRafael U. C. AfonsoMax Rydahl AndersenAvalonFederico BarbieriJeffrey BarnesNicola Ken BarozziArron BatesSebastian BazleyBenjamin BentmannOla BergSam BerlinChristopher BerryNathan BeyerRune Peter BjørnstadJanek BoguckiMaarten BrakDave BrysonChuck BurdickJulien BuretJosh CainJonathan CarlsonRam ChidambaramSteve ClarkBenoit CorneEric CramptonDimiter DimitrovPeter DonaldSteve DowneyRich DoughertyTom DunhamStefano FornariAndrew FreemanGerhard FroehlichGoran HacekDavid HayMario IvankovitsPaul JackEric JohnsonKent JohnsonMarc JohnsonRoger KapsiNissim KarpensteinShinobu KawaiStephen KestleMohan KishoreSimon KitchingThomas KnychSerge KnystautasPeter KoBekJordan KreyOlaf KrischeGuilhem LavauxPaul LegatoDavid LeppikBerin LoritschHendrik MarynsStefano MazzocchiBrian McCallisterDavid MeikleSteven MelzerLeon MesserschmidtMauricio S. MouraKasper NielsenStanislaw OsinskiAlban PeignierMike PettypieceSteve PhelpsIlkka PrihaJonas Van PouckeWill PughHerve QuirozDaniel RallRobert RibnitzHuw RobertsHenning P. SchmiedehausenJoerg SchmueckerHoward Lewis ShipJoe RaysaJeff RodriguezAshwin SJordane SardaThomas SchapitzJon ScheweAndreas SchlosserChristian SiefkesMichael SmithStephen SmithJan SorensenJon S. StevensJames StrachanLeo SuticChris TildenNeil O'TooleJeff TurnerKazuya UjiharaThomas VahrstJeff VarszegiRalph WagnerHollis WaiteDavid WeinrichDieter WimbergerSerhiy YevtushenkoSai ZhangJason van Zyljunitjunit4.11testorg.easymockeasymock3.2testapache.websiteApache Commons Site${commons.deployment.protocol}://people.apache.org/www/commons.apache.org/${commons.componentid}UTF-8UTF-81.51.5collections44.0(Java 5.0+)3.2.1(Requires Java 1.2 or later)commons-collections-${commons.release.2.version}COLLECTIONS12310465RC52.9.1collectionshttps://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-collectionssite-content2.9.1org.apache.maven.pluginsmaven-surefire-plugin**/*Test.java**/*$***/TestUtils.java**/Abstract*.java**/BulkTest.javamaven-assembly-pluginsrc/main/assembly/bin.xmlsrc/main/assembly/src.xmlgnumaven-checkstyle-plugin${checkstyle.version}${basedir}/src/conf/checkstyle.xmlfalseorg.apache.maven.pluginsmaven-scm-publish-pluginjavadocsorg.apache.maven.pluginsmaven-changes-plugin${commons.changes.version}%URL%/%ISSUE%falseFix Version,Key,Summary,Type,Resolution,StatusKey DESC,Type,Fix Version DESCFixedResolved,ClosedBug,New Feature,Task,Improvement,Wish,Test${commons.release.version}500changes-reportjira-reportmaven-checkstyle-plugin${checkstyle.version}${basedir}/src/conf/checkstyle.xmlfalse${basedir}/src/conf/checkstyle-suppressions.xmlcheckstyleorg.codehaus.mojoclirr-maven-plugin${commons.clirr.version}${minSeverity}org.codehaus.mojofindbugs-maven-plugin2.5.2NormalDefault${basedir}/src/conf/findbugs-exclude-filter.xmlorg.codehaus.mojocobertura-maven-plugin2.5.2maven-pmd-plugin2.7.1${maven.compiler.target}pmdcpdorg.apache.ratapache-rat-pluginsite-content/**/*maven-eclipse.xmlsetup-checkoutsite-contentorg.apache.maven.pluginsmaven-antrun-plugin1.7prepare-checkoutpre-siterun
commons-collections4-4.0-src/build.xml 100664 31607 12243235515 16064 0 ustar tn tn 0 0
commons-collections4-4.0-src/NOTICE.txt 100664 264 12243235515 15720 0 ustar tn tn 0 0 Apache Commons Collections
Copyright 2001-2013 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
commons-collections4-4.0-src/README.txt 100664 3144 12243235515 15714 0 ustar tn tn 0 0 Apache Commons Collections
===========================
Welcome to the Collections component of the Apache Commons project.
This component contains many new collections and collection utilities.
Two jar files (apart from sources and javadocs) are produced by this component.
The first, commons-collections4-x.y.jar is the main jar used by applications.
The second, commons-collections4-x.y-tests.jar is an extension to junit
for testing new collection implementations and is not normally used by applications.
Building from source
=-=-=-=-=-=-=-=-=-=-
Maven2
------
Collections is usually built using Maven2.
It can be found here :
http://maven.apache.org/
Once installed, the major goals are:
mvn package - build jars
mvn install - place jars in local maven repository
mvn assembly:assembly - build tar.gz/zips
Ant
---
It may also be built using Ant.
It can be found here :
http://ant.apache.org/
For testing the project, you will also need JUnit :
http://www.junit.org/
To let the test process find JUnit, you may make a
copy of the build.properties.sample file, rename to
build.properties, and modify to reflect
the location of the junit.jar on your computer.
Once you have Ant properly installed, and the
build.properties file correctly reflects the location
of your junit.jar, you are ready to build and test.
The major targets are:
ant compile - compile the code
ant test - test using junit
ant jar - create a jar file
ant test-jar - create the testframework jar file
ant javadoc - build the javadoc
ant dist - create folders as per a distribution
commons-collections4-4.0-src/RELEASE-NOTES.txt 100664 73554 12243235515 16761 0 ustar tn tn 0 0
Apache Commons Collections
Version 4.0
RELEASE NOTES
INTRODUCTION:
Commons collections is a project to develop and maintain collection classes
based on and inspired by the JDK collection framework.
This version uses the generics features of Java 5 and is not compatible with
earlier JDK versions.
The process of generifying an API is complex.
For commons-collections, we have chosen to break the API in various ways.
The aim behind this is to provide an API design that better suits generics.
We have also removed all deprecated classes and fixed oddities in the previous
API that we couldn't fix due to backwards compatibility restrictions.
As such, this release can not be considered to be a simple, drop-in, replacement
for commons-collections. To help with the migration to this new version, the
package has changed to "org.apache.commons.collections4", thus it is possible
to have both commons-collections versions in the classpath.
These release notes will try to guide you in the process of upgrading, however you
should remember that this is a new API based on the original, so some concepts
have changed.
Compatibility
-------------
o Java 5 or later is required.
o This release is not source or binary compatible with previous releases of
Commons Collections. This includes releases from the 3.x branch as well as
preceding alpha releases for 4.0 (see details of changes below).
o some unit tests are disabled when executed with an IBM JDK 6 due to a faulty
java.util.TreeMap implementation.
Major changes since 3.2.1
-------------------------
o Use of generics and other language features introduced in Java 5 (varargs, Iterable)
o Removed deprecated classes / methods and features which are now supported by the JDK
o Replaced Buffer interface with java.util.Queue
o Added concept of split maps with respective interfaces Put / Get (see also package splitmap)
o Added new Trie interface together with an implementation of a Patricia Trie
Changes since 4.0-alpha1
------------------------
o [COLLECTIONS-502] Resolved generic parameter inconsistency for various static fields, e.g. BagUtils.EMPTY_BAG,
TruePredicate.INSTANCE and many others. All accessible static fields use raw types so that
they can be used directly without explicit casting. To avoid compiler warnings about unchecked
conversion and/or rawtypes use the corresponding factory methods, e.g. BagUtils.emptyBag().
o [COLLECTIONS-501] Renamed methods "V MultiKeyMap#remove(Object, Object, ...)" to
"V MultiKeyMap#removeMultiKey(Object, Object, ...)" to avoid future conflicts
with a default method of the Map interface in Java 8.
o [COLLECTIONS-500] Renamed "V MultiMap#remove(K, V)" to "boolean MultiMap#removeMapping(K, V)"
to avoid future conflicts with a default method of the Map interface in Java 8.
o [COLLECTIONS-499] Refactored the test framework for Bag implementations to extend from
"AbstractCollectionTest" by decorating the concrete Bag instance with
a CollectionBag or CollectionSortedBag.
o [COLLECTIONS-498] "CollectionBag" will now also respect the contract of the decorated bag in case
a null argument is provided to either removeAll or retainAll.
o [COLLECTIONS-497] Added bag decorator "CollectionSortedBag" which decorates a SortedBag to make it
comply with the Collection contract.
o [COLLECTIONS-496] "UnmodifiableBoundedCollection" does now also implement the marker interface "Unmodifiable"
similar as all other unmodifiable decorators.
o [COLLECTIONS-495] "UnmodifiableTrie#unmodifiableTrie(Trie)" will not decorate again an already unmodifiable Trie.
Also the return type has been changed to "Trie" to be consistent with other Unmodifiable decorators.
o [COLLECTIONS-494] Moved "Equator" interface to base package for consistency. Thanks to Emmanuel Bourg.
o [COLLECTIONS-488] Added "CollectionsUtils#matchesAll(Iterable, Predicate)" to test if all elements
of a collection match a given predicate. Thanks to Josh Cain.
o [COLLECTIONS-485] Accept wildcard input where possible, e.g. in copy-constructors, Unmodifiable* decorators
and iterators. Thanks to Hollis Waite.
o [COLLECTIONS-481] No collision detection/resolution was performed when calling "CompositeSet#addComposited(...)"
with more than one Set as argument. Additionally use varargs parameters instead of arrays
in CompositeSet and CompositeCollection constructor and addComposited method. Thanks to Hollis Waite.
o [COLLECTIONS-480] Narrow return type of "BidiMap#values()" to Set as the values are required to be unique. Thanks to Hollis Waite.
o [COLLECTIONS-468] Renamed CompliantBag to CollectionBag.
o [COLLECTIONS-475] Fixed conversion of timeout parameters in "PassiveExpiringMap".
Removed classes
---------------
o [COLLECTIONS-458] Removed unused class "AbstractUntypedCollectionDecorator"
o [COLLECTIONS-432] Removed "Buffer" interface and all its implementations and related classes.
Replaced by "java.util.Queue", see also section [New classes]
- PriorityBuffer: use either java.util.PriorityQueue or java.util.concurrent.PriorityBlockingQueue
- SynchronizedBuffer: use the corresponding *BlockingQueue classes in java.util.concurrent
- BoundedBuffer: use either ArrayBlockingBuffer(capacity) or LinkedBlockingBuffer(capacity) in java.util.concurrent
- UnboundedFifoBuffer: use either java.util.LinkedList or java.util.concurrent.LinkedBlockingBuffer
o [COLLECTIONS-351] Removed features now supported by the JDK or other Apache Commons libraries
- FastArrayList: use java.util.concurrent.CopyOnWriteArrayList
- FastHashMap: use java.util.concurrent.ConcurrentHashMap, but beware of null keys and values
- FastTreeSet: no direct replacement, use ConcurrentHashMap or a synchronized TreeMap
- IdentityMap: use java.util.IdentityHashMap
- ExtendedProperties: use commons-configuration
- Synchronized[List,Set,SortedSet]: use java.util.Collections.synchronized*()
- Typed* decorators: use generics for type safety, or java.util.Collections.checked*()
- [List,Set,Map]Utils.EMPTY_*: use the corresponding fields in java.util.Collections
o [COLLECTIONS-229] Removed deprecated collection classes and methods
New classes
-----------
o [COLLECTIONS-497] CollectionSortedBag - decorates a SortedBag to make it comply with the Collection contract.
o [COLLECTIONS-468] CollectionBag - decorates another Bag to make it comply with the Collection contract.
o [COLLECTIONS-463] PushbackIterator - supports pushback of elements during iteration. Thanks to Andy Seaborne, Claude Warren.
o [COLLECTIONS-462] PeekingIterator - supports one-element lookahead during iteration. Thanks to Andy Seaborne, Claude Warren.
o [COLLECTIONS-432] CircularFifoQueue - analogous class to CircularFifoBuffer for the Queue interface
PredicatedQueue - analogous class to PredicatedBuffer
TransformedQueue - analogous class to TransformedBuffer
UnmodifiableQueue - analogous class to UnmodifiableBuffer
QueueUtils - analogous class to BufferUtils
o [COLLECTIONS-422] PermutationIterator - generates unordered permutations of a collection. Thanks to Benoit Corne.
o [COLLECTIONS-404] SequencesComparator - an implementation of Eugene Myers difference algorithm in package o.a.c.c.sequence. Thanks to Jordane Sarda.
o [COLLECTIONS-396] LazyIteratorChain - a variant of IteratorChain which supports lazy initialization. Thanks to Jeff Rodriguez.
o [COLLECTIONS-322] NodeListIterator - supports iteration over a org.w3c.dom.NodeList. Thanks to Thomas Vahrst.
o [COLLECTIONS-313] CatchAndRethrowClosure - re-throws any checked exception as unchecked "FunctorException". Thanks to David J. M. Karlsen.
o [COLLECTIONS-275] IndexedCollection - collection decorator which provides a map-like view on an existing collection. Thanks to Stephen Kestle.
o [COLLECTIONS-258] DualLinkedHashBidiMap - bidi map implementation using LinkedHashMap instances. Thanks to Nathan Blomquist.
o [COLLECTIONS-242] Equator - interface for testing object equality.
o [COLLECTIONS-241] PassiveExpiringMap - map decorator which passively expires entries. Thanks to Elifarley Callado Coelho.
o [COLLECTIONS-225] PatriciaTrie - PATRICIA trie implementation for the new Trie interface, together with Unmodifiable and
Synchronized decorators. Thanks to Sam Berlin and Roger Kapsi.
o [COLLECTIONS-8 ] ComparatorPredicate - predicate to compare objects against a fixed instance. Thanks to Rune Peter Bjørnstad.
o [None ] Put / Get - interfaces for split maps
o [None ] SplitMapUtils / splitmap.TransformedSplitMap - utilities and implementation for split maps
New methods in *Utils
---------------------
o [COLLECTIONS-488] Added "CollectionsUtils#matchesAll(Iterable, Predicate)" to test if all elements
of a collection match a given predicate. Thanks to Josh Cain.
o [COLLECTIONS-456] ListUtils#longestCommonSubsequence(...) to get the longest common subsequence of arbitrary lists or CharSequences.
o [COLLECTIONS-450] CollectionUtils#forAllButLastDo(Collection, Closure) and forAllButLastDo(Iterator, Closure). Thanks to J. Moldawski.
o [COLLECTIONS-446] CollectionUtils#isEqualCollection(Collection, Collection, Equator). Thanks to Matt Lachman.
o [COLLECTIONS-436] *Utils#emptyIfNull(*) methods in classes CollectionUtils, ListUtils, SetUtils and MapUtils. Thanks to Arman Sharif.
o [COLLECTIONS-429] CollectionUtils#containsAll(Collection, Collection) with guaranteed runtime complexity of O(n + m)
+COLLECTIONS-434] and space complexity of O(n). This method may yield much better performance than Collection.containsAll(Collection)
depending on the use-case and type of collection used. Thanks to Adrian Nistor, Mert Guldur.
o [COLLECTIONS-422] CollectionUtils#permutations(Collection) to generate all permutations of a collection. Thanks to Benoit Corne.
o [COLLECTIONS-405] ListUtils#select() and ListUtils#selectRejected() methods. Thanks to Adam Dyga.
o [COLLECTIONS-393] ListUtils#partition() to split a List into consecutive sublists. Thanks to Chris Shayan.
o [COLLECTIONS-383] CollectionUtils#forAllDo(Iterator, Closure). Thanks to Adrian Cumiskey.
o [COLLECTIONS-375] ListUtils#defaultIfNull(List, List). Thanks to Ivan Hristov.
o [COLLECTIONS-361] CollectionUtils#filterInverse(Iterable, Predicate). Thanks to Jean-Noel Rouvignac.
o [COLLECTIONS-306] CollectionUtils#subtract(Iterable, Iterable, Predicate). Thanks to Chris Shayan.
o [COLLECTIONS-296] CollectionUtils#collate(...) to merge two sorted Collections using the standard O(n) merge algorithm. Thanks to Julius Davies.
o [COLLECTIONS-286] CollectionUtils#extractSingleton(Collection). Thanks to Geoffrey De Smet.
o [COLLECTIONS-263] MapUtils#populateMap(MultiMap, ...) to support also "MultiMap" instances as input. Thanks to John Hunsley.
o [COLLECTIONS-235] ListUtils#indexOf(List, Predicate). Thanks to Nathan Egge.
o [COLLECTIONS-194] MapUtils#populateMap(Map, Iterable, Transformer, ...). Thanks to Dave Meikle.
New features
------------
o [COLLECTIONS-399] Added new method "get(int)" to "CircularFifoQueue". Thanks to Sebb.
o [COLLECTIONS-327] Added serialVersionUID fields for "CompositeCollection", "CompositeSet", "EmptyMapMutator", "EmptySetMutator". Thanks to sebb.
o [COLLECTIONS-293] Added support for using custom "Equator" objects in "EqualPredicate". Thanks to Stephen Kestle.
o [COLLECTIONS-289] Added method "CollatingIterator#getIteratorIndex()". Thanks to Fredrik Kjellberg.
o [COLLECTIONS-285] Added serialization support for "TreeBidiMap". Thanks to Christian Gruenberg.
o [COLLECTIONS-272] Added serialization support for "FixedOrderComparator" and "TransformingComparator". Thanks to Chaitanya Mutyala.
o [COLLECTIONS-260] Added constructor "TransformingComparator(Transformer)". Thanks to Stephen Kestle.
o [COLLECTIONS-237] Added method "MultiValueMap#iterator()" to return a flattened version of "entrySet().iterator()".
Clarified javadoc for "entrySet()" that the returned Entry objects are unflattened, i.e. the Entry object
for a given key contains all values mapped to this key. Thanks to Nils Kaiser, Alan Mehlo.
o [COLLECTIONS-226] Added method "ListOrderedMap#putAll(int, Map)". Thanks to Vasily Ivanov.
o [COLLECTIONS-213] Added support for resettable iterators in "IteratorIterable". Thanks to Dusan Chromy.
Changed classes / methods
-------------------------
o [COLLECTIONS-502] Resolved generic parameter inconsistency for various static fields, e.g. BagUtils.EMPTY_BAG,
TruePredicate.INSTANCE and many others. All accessible static fields use raw types so that
they can be used directly without explicit casting. To avoid compiler warnings about unchecked
conversion and/or rawtypes use the corresponding factory methods, e.g. BagUtils.emptyBag().
o [COLLECTIONS-501] Renamed methods "V MultiKeyMap#remove(Object, Object, ...)" to
"V MultiKeyMap#removeMultiKey(Object, Object, ...)" to avoid future conflicts
with a default method of the Map interface in Java 8.
o [COLLECTIONS-500] Renamed "V MultiMap#remove(K, V)" to "boolean MultiMap#removeMapping(K, V)"
to avoid future conflicts with a default method of the Map interface in Java 8.
o [COLLECTIONS-499] Refactored the test framework for Bag implementations to extend from
"AbstractCollectionTest" by decorating the concrete Bag instance with
a CollectionBag or CollectionSortedBag.
o [COLLECTIONS-496] "UnmodifiableBoundedCollection" does now also implement the marker interface "Unmodifiable"
similar as all other unmodifiable decorators.
o [COLLECTIONS-495] "UnmodifiableTrie#unmodifiableTrie(Trie)" will not decorate again an already unmodifiable Trie.
Also the return type has been changed to "Trie" to be consistent with other Unmodifiable decorators.
o [COLLECTIONS-494] Moved "Equator" interface to base package for consistency. Thanks to Emmanuel Bourg.
o [COLLECTIONS-485] Accept wildcard input where possible, e.g. in copy-constructors, Unmodifiable* decorators
and iterators. Thanks to Hollis Waite.
o [COLLECTIONS-480] Narrow return type of "BidiMap#values()" to Set as the values are required to be unique. Thanks to Hollis Waite.
o [COLLECTIONS-473] Made field "collection" in class "AbstractCollectionDecorator" private and added
setter "setCollection(Collection)" with scope protected to set the decorated collection
during de-serialization.
o [COLLECTIONS-466] Replaced "Collection" with "Iterable" for method arguments where applicable.
o [COLLECTIONS-460] Changed "IteratorChain" to use internally a "Queue" instead of a "List". Iterators are
removed from the queue once used and can be garbage collected after being exhausted.
Additionally removed the methods "setIterator(Iterator)" and "getIterators()".
o [COLLECTIONS-459] Removed method "setArray(Object)" in class ArrayIterator and method "setArray(Object[])"
in class ObjectArrayIterator and made fields array, startIndex and endIndex final and package private.
o [COLLECTIONS-455] Changed scope of various fields to private / package private where appropriate.
o [COLLECTIONS-454] An iterator over a "Flat3Map#entrySet()" will now return independent Map.Entry objects that will
not change anymore when the iterator progresses.
o [COLLECTIONS-453] Several closure and transformer implementations in the functor package will now copy
an array as input parameter to their constructor (e.g. ChainedClosure).
o [COLLECTIONS-452] Change base package to "org.apache.commons.collections4".
o [COLLECTIONS-451] The constructors for all *Utils classes are now private to prevent instantiation.
o [COLLECTIONS-424] "CompositeSet" does not inherit from "CompositeCollection" anymore. The inner class "SetMutator"
has been updated accordingly. Thanks to Michael Pradel.
o [COLLECTIONS-382] Change maven coordinates to "org.apache.commons.commons-collections4". Thanks to Olivier Lamy.
o [COLLECTIONS-381] Move the project structure to a standard maven layout. Thanks to Olivier Lamy.
o [COLLECTIONS-372] TransformingComparator now supports different types for its input/output values.
o [COLLECTIONS-362] "CollectionUtils#filter(Iterable, Predicate)" will now return whether the collection has been modified.
Thanks to Jean-Noel Rouvignac.
o [COLLECTIONS-341] "NOPClosure" is now a final class. Thanks to Goran Hacek.
o [COLLECTIONS-324] Fields transformer and decorated in class "TransformingComparator" are now final. Thanks to sebb.
o [COLLECTIONS-307] "SetUniqueList#subList()" will now return an unmodifiable list as changes to it may invalidate the parent list.
Thanks to Christian Semrau, Thomas Vahrst.
o [COLLECTIONS-298] Calling "CollectionUtils#sizeIsEmpty(null)" will now return true. Thanks to Benjamin Bentmann.
o [COLLECTIONS-280] The predicate that rejected an object to be added to a "PredicatedCollection" is now contained in the
respective exception message. Thanks to Chris Lewis.
o [COLLECTIONS-265] "TreeBag" will now only accept "Comparable" objects as input when used with natural ordering. Thanks to David Saff.
o [COLLECTIONS-251] The static factory methods have been renamed from "getInstance()" to a camel-case version of the class name,
+COLLECTIONS-321] e.g. "truePredicate()" for class "TruePredicate". Thanks to Stephen Kestle.
o [COLLECTIONS-240] "MultiValueMap" is now serializable. Thanks to Wouter de Vaal.
o [COLLECTIONS-231] Return concrete class in static factory methods instead of base class interface
(except for Unmodifiable decorators). Thanks to Torsten Curdt.
o [COLLECTIONS-230] "CollectionUtils#size(Collection)" now returns 0 when called with null as input. Thanks to Stepan Koltsov,sebb.
+COLLECTIONS-297]
+COLLECTIONS-318]
o [COLLECTIONS-223] "CollectionUtils#addAll(...)" methods now return if the collection has been changed by this operation.
Thanks to Vasily Ivanov.
o [COLLECTIONS-221] "CompositeCollection", "CompositeMap" and "CompositeSet" are now serializable. Thanks to Pal Denes.
o [COLLECTIONS-218] The "CollectionUtils#select(Collection, Predicate, Collection)" method will now return the output collection.
o [COLLECTIONS-182] "CollectionUtils#forAllDo(Collection, Closure)" now returns the provided closure. Thanks to Jim Cakalic.
o [COLLECTIONS-110] Make generic versions of all classes in collections.
+COLLECTIONS-243]
+COLLECTIONS-245]
+COLLECTIONS-247]
+COLLECTIONS-253]
+COLLECTIONS-273]
+COLLECTIONS-282]
o [None ] Switch Abstract*Decorator classes to expose decorated() protected method instead of the decorated collection directly.
Each class overrides decorated() to add its type covariantly, thus getList()/getSet() etc. methods are removed
o [None ] ArrayStack is now deprecated and will be removed in the next major release. It is replaced by the java.util.Deque
interface available from Java 6.
Fixed Bugs
----------
o [COLLECTIONS-498] "CollectionBag" will now also respect the contract of the decorated bag in case
a null argument is provided to either removeAll or retainAll.
o [COLLECTIONS-481] No collision detection/resolution was performed when calling "CompositeSet#addComposited(...)"
with more than one Set as argument. Additionally use varargs parameters instead of arrays
in CompositeSet and CompositeCollection constructor and addComposited method. Thanks to Hollis Waite.
o [COLLECTIONS-475] Fixed conversion of timeout parameters in "PassiveExpiringMap".
o [COLLECTIONS-474] ListOrderedMap#putAll(index, Object, Object) does not throw an exception anymore if the
map contains null values. Additionally added javadoc clarification on the supported bounds
for the index parameter. Thanks to Ning Chen.
o [COLLECTIONS-472] Improved performance of "AbstractMapBag#containsAll(Collection)" by returning immediately
after a difference has been found. Thanks to Adrian Nistor.
o [COLLECTIONS-461] Added additional clarification to javadoc of interface "Put" wrt return type of
"put(Object, Object)" method. Thanks to Matt Benson, sebb.
o [COLLECTIONS-447] Tree traversal with a TreeListIterator will not be affected anymore by the removal of an element directly after
a call to previous(). Thanks to Jeffrey Barnes.
o [COLLECTIONS-445] Adapt and/or ignore several unit tests when run on a IBM J9 VM (specification version 1.6.0) due to a faulty
"java.util.TreeMap" implementation.
o [COLLECTIONS-444] SetUniqueList.set(int, E) now works correctly if the object to be inserted is already placed at the given position.
Thanks to Thomas Vahrst, John Vasileff.
o [COLLECTIONS-441] MultiKeyMap.clone() now correctly calls super.clone(). Thanks to Thomas Vahrst.
o [COLLECTIONS-433] Improve performance of "TreeList#addAll" and "TreeList(Collection)" by converting the input collection into an
AVL tree and efficiently merge it into the existing tree. Thanks to Jeffrey Barnes.
o [COLLECTIONS-427] Fixed performance issue in "SetUniqueList#retainAll" method for large collections. Thanks to Mert Guldur.
o [COLLECTIONS-426] Fixed performance issue in "ListOrderedSet#retainAll" method for large collections. Thanks to Adrian Nistor.
o [COLLECTIONS-425] Improved performance of "ListOrderedMap#remove(Object)" method. Thanks to Adrian Nistor.
o [COLLECTIONS-421] Update javadoc for "ListUtils#lazyList()" and "ListUtils#fixedSizeList()". Thanks to Benedikt Ritter.
o [COLLECTIONS-419] Added clarifying javadoc wrt runtime complexity of "AbstractDualBidiMap#retainAll". Thanks to Adrian Nistor.
o [COLLECTIONS-417] Added clarifying javadoc wrt runtime complexity of "AbstractLinkedList#retainAll". Thanks to Adrian Nistor.
o [COLLECTIONS-415] Added clarifying javadoc wrt runtime complexity of "AbstractLinkedList#removeAll". Thanks to Adrian Nistor.
o [COLLECTIONS-414] Fixed several compilation issues with older Java 1.6 compilers.
o [COLLECTIONS-413] Improved performance of "removeAll()" method for sets returned by "DualHashBidiMap#entrySet()". Thanks to Adrian Nistor.
o [COLLECTIONS-412] Improved performance of "CollectionUtils#subtract" methods. Thanks to Adrian Nistor.
o [COLLECTIONS-411] Fixed possible "IndexOutOfBoundsException" in "ListOrderedMap#putAll". Thanks to Adrian Nistor.
o [COLLECTIONS-410] Improved performance of "SetUniqueList#addAll" method. Thanks to Adrian Nistor.
o [COLLECTIONS-409] Improved performance of "ListOrderedSet#addAll" method. Thanks to Adrian Nistor.
o [COLLECTIONS-408] Improved performance of "SetUniqueList#removeAll". Thanks to Adrian Nistor.
o [COLLECTIONS-407] Improved performance of "ListOrderedSet#remove(Object)" in case the object is not contained in the Set. Thanks to Adrian Nistor.
o [COLLECTIONS-406] Improved performance of "ListUtils#subtract" method. Thanks to Adrian Nistor.
o [COLLECTIONS-400] Added missing null check in "CollectionUtils#addIgnoreNull(Collection, Object)". Thanks to Shin Hwei Tan.
o [COLLECTIONS-391] Fixed javadoc for "MapUtils#toProperties(Map)". Thanks to Shin Hwei Tan.
o [COLLECTIONS-389] Clarified javadoc for "TransformerUtils#mapTransformer" for null input. Thanks to Shin Hwei Tan.
o [COLLECTIONS-388] Clarified javadoc for "FactoryUtils#prototypeFactory" for null input. Thanks to Shin Hwei Tan.
o [COLLECTIONS-384] Fixed inconsistent javadoc for "MapUtils#synchronizedMap(Map)". Thanks to Shin Hwei Tan.
o [COLLECTIONS-380] Fixed infinite loop when calling "UnmodifiableBoundedCollection#unmodifiableBoundedCollection()". Thanks to Dave Brosius.
o [COLLECTIONS-379] Fixed javadoc for several methods wrt expected NullPointerExceptions. Thanks to Shin Hwei Tan.
o [COLLECTIONS-364] "DualTreeBidiMap" now uses the correct comparator for the reverse map during de-serialization.
o [COLLECTIONS-363] "TransformedMap" in the package "splitmap" can now be serialized.
o [COLLECTIONS-360] "FilterListIterator#hasNext" does not throw a NullPointerException anymore to comply to the Java iterator specification.
Thanks to Sai Zhang.
o [COLLECTIONS-359] "ListUtils#intersection(List, List)" will now also work correctly if there are duplicate elements in the provided lists.
Thanks to Mark Shead.
o [COLLECTIONS-352] "AbstractCollectionDecorator" will now use internally "decorated()" to access the decorated collection. Thanks to Adam Gent.
o [COLLECTIONS-350] Removed debug output in "MapUtils#getNumber(Map)". Thanks to Michael Akerman.
o [COLLECTIONS-348] Fixed javadoc for all "transformedXXX(XXX)" methods in the respective Utils classes to clarify that existing objects in the
list are not transformed. Thanks to Paul Benedict.
o [COLLECTIONS-343] Singleton classes in package "functors" are now correctly de-serialized. Thanks to Goran Hacek.
o [COLLECTIONS-340] Removed broken methods "equals(Object)" and "hashCode()" in class "NOPClosure". Thanks to Goran Hacek.
o [COLLECTIONS-336] Simplified exceptions as the cause is available from the parent. Thanks to sebb.
o [COLLECTIONS-335] Fixed cache assignment for "TreeBidiMap#entrySet". Thanks to sebb.
o [COLLECTIONS-334] Synchronized access to lock in "StaticBucketMap#size()". Thanks to sebb.
o [COLLECTIONS-332] Added clarification to javadoc of "ListOrderedMap" that "IdentityMap" and "CaseInsensitiveMap" are not supported.
Thanks to Tom Parker.
o [COLLECTIONS-331] Improve javadoc of "CollatingIterator" wrt the used "Comparator" and throw a NullPointerException in "CollatingIterator#least"
if no comparator is set. Thanks to Michael Krkoska.
o [COLLECTIONS-330] "LRUMap#keySet()#remove(Object)" will not throw a "ConcurrentModificationException" anymore. Thanks to Joerg Schaible.
o [COLLECTIONS-328] Improved performance of "ListUtils#intersection(List, List)". Thanks to Thomas Rogan, Jilles van Gurp.
o [COLLECTIONS-323] Changed behavior of "CaseInsensitiveMap" constructor to be compliant with "HashMap" in case the initial capacity is set to zero.
Thanks to Maarten Brak.
o [COLLECTIONS-320] Improved performance of "StaticBucketMap#putAll(Map)" by iterating over the entry set. Thanks to sebb.
o [COLLECTIONS-319] Avoid redundant null check in "IteratorUtils#getIterator(Object)". Thanks to sebb.
o [COLLECTIONS-317] Use a private method to populate the object in "AbstractHashedMap(Map)". Thanks to sebb.
o [COLLECTIONS-316] Fixed javadoc of "LRUMap" wrt to the maxSize parameter of the constructor. Thanks to ori.
o [COLLECTIONS-312] Use of final keyword where applicable, minor performance improvements by properly initializing the capacity of newly created
collections when known in advance. Thanks to Peter Lawrey, Gary Gregory.
o [COLLECTIONS-307] "SetUniqueList#subList()#contains(Object)" will now correctly check the subList rather than the parent list.
Thanks to Christian Semrau.
o [COLLECTIONS-304] "SetUniqueList#set(int, Object)" will now correctly enforce the uniqueness constraint. Thanks to Rafał Figas,Bjorn Townsend.
o [COLLECTIONS-303] Improved javadoc for "Unmodifiable*" classes wrt behavior when the users tries to modify the collection. Thanks to Emmanuel Bourg.
o [COLLECTIONS-294] "CaseInsensitiveMap" will now convert input strings to lower-case in a locale-independant manner. Thanks to Benjamin Bentmann.
o [COLLECTIONS-256] Fixed javadoc for "ListUtils#transformedList(List)" to clarify that existing objects in the list are not transformed.
+COLLECTIONS-288] Thanks to Paul Benedict.
o [COLLECTIONS-266] "MultiKey" will now be correctly serialized/de-serialized. Thanks to Joerg Schaible.
o [COLLECTIONS-262] Fixed javadoc for methods "firstKey()" and "lastKey()" in class "AbstractLinkedMap". Thanks to Lisen Mu.
o [COLLECTIONS-261] "Flat3Map#remove(Object)" will now return the correct value mapped to the removed key if the size of the map is less or equal 3.
Thanks to ori.
o [COLLECTIONS-255] Removed unused variables in "TreeBidiMap". Thanks to Henri Yandell.
o [COLLECTIONS-249] "SetUniqueList.addAll(int, Collection)" now correctly add the collection at the provided index. Thanks to Joe Kelly.
o [COLLECTIONS-232] Fixed several unit tests which were using parameters to "assertEquals(...)" in wrong order. Thanks to Mark Hindess.
o [COLLECTIONS-228] "MultiValueMap#put(Object, Object)" and "MultiValueMap#putAll(Object, Collection)" now correctly return if the map
has changed by this operation.
o [COLLECTIONS-219] "CollectionUtils#removeAll" wrongly called "ListUtils#retainAll". Thanks to Tom Leccese.
o [COLLECTIONS-217] Calling "setValue(Object)" on any Entry returned by a "Flat3Map" will now correctly set the value for the current entry.
Thanks to Matt Bishop.
o [COLLECTIONS-216] "MultiKey#toString()" will now use "Arrays#toString(List)". Thanks to Hendrik Maryns.
For complete information on Commons Collections, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Commons Collections website:
http://commons.apache.org/proper/commons-collections/
commons-collections4-4.0-src/LICENSE.txt 100664 26136 12243235515 16067 0 ustar tn tn 0 0
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
commons-collections4-4.0-src/DEVELOPERS-GUIDE.html 100664 12076 12243235515 17433 0 ustar tn tn 0 0
Developers guide for Apache Commons "Collections" Package
The Collections package contains a set of Java classes that extend
or augment the Java Collections Framework. This developers guide seeks to set
out rules for the naming of classes and methods within the package. The purpose
of this, as with all naming standards, is to improve the coherency and
consistency of the whole API.
The philosophy of the naming standards is to follow those of
java.util.Collections.
2. COLLECTION INTERFACES
Collection interfaces are new types of collections not included in Java.
Examples include Bag and SortedBag. These interfaces
shall:
be top level interfaces
have a name that describes their purpose
3. COLLECTION IMPLEMENTATIONS
Collection implementation are new implementations of collection interfaces.
Examples include DoubleOrderedMap and DefaultMapBag.
These interfaces shall:
be top level classes
have a name that ends with the collection type being implemented
have a name that describes their implementation
contain no public inner classes
only contain the collection implementation, and any methods specific to
that implementation
4. UTILITY CLASSES
Utility classes provide additional functionality around an interface and
its basic implementations. Examples include CollectionUtils and ListUtils.
Each class shall follow the naming pattern XxxUtils where Xxx relates to the
object being returned by the class, for example ListUtils and
BagUtils. Variations on a theme (SortedBag as opposed
to Bag) will be dealt with in one Utils class. Each Utils class
shall:
be a single, static method based, class
have a name consisting of the interface name plus 'Utils'
deal with one collection interface and its variations
provide methods that decorate the interface with additional
functionality
provide methods that perform useful utility functions on that
interface
Where the method in a Utils class is a decorator, the name shall consist of
an adjective followed by the collection type. Typically such adjective is
formed by appending an -ed suffix (meaning "having"/"characterized by") to the
word describing the type of decorator. For example,
synchronizedMap(Map) or predicatedSet(Set).
Occasionally, such construct is awkward and a more suitable adjective can be
used instead. For example, lazyList,
unmodifiableList.
These decorators should be implemented either as non-public, static,
inner classes, or as public classes in a subpackage. If a subpackage is used,
the constructors should be protected and a public static decorate() method
provided on each class for construction.
5. CODING STANDARDS
Commons Collections follows similar style rules to many other Java open source
projects, and the Sun conventions. Some specific conventions are:
No tabs, 4 space indentations
Curly brackets open at line end
Else, catch and finally statements after the closing bracket
Single space after keyword such as if
Two spaces between parameter name and description in @param
Generally copy the style of the surrounding code
And remember, the commons-dev mailing list is there for any discussions
or queries about patches or new additions to collections.