Package net.cscott.jutil
Class Factories
java.lang.Object
net.cscott.jutil.Factories
Factories consists exclusively of static methods that
operate on or return CollectionFactorys.- Author:
- Felix S. Klock II <pnkfelix@mit.edu>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ListFactoryDeprecated.static final MapFactoryDeprecated.UsehashMapFactory(), which is parameterized.static final SetFactoryDeprecated.UsehashSetFactory(), which is parameterized.static final SetFactoryDeprecated.UselinearSetFactory(), which is parameterized.static final MapFactoryDeprecated.UselinkedHashMapFactory(), which is parameterized.static final SetFactoryDeprecated.UselinkedHashSetFactory(), which is parameterized.static final ListFactoryDeprecated.UselinkedListFactory(), which is parameterized.static final MapFactoryDeprecated.UsetreeMapFactory(), which is parameterized.static final SetFactoryDeprecated.UsetreeSetFactory(), which is parameterized.static final SetFactoryDeprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic final <V> ListFactory<V> static final <K extends Enum<K>,V>
MapFactory<K, V> enumMapFactory(Class<K> enumClass) AMapFactorythat generatesEnumMaps.static final <V extends Enum<V>>
SetFactory<V> enumSetFactory(Class<V> enumClass) ASetFactorythat generatesEnumSets.static final <K,V> MapFactory <K, V> static final <V> SetFactory<V> static final <V> SetFactory<V> static final <K,V> MapFactory <K, V> Returns aMapFactorythat generatesLinkedHashMaps.static final <V> SetFactory<V> Returns aSetFactorythat generatesLinkedHashSets.static final <V> ListFactory<V> static <K,V> SetFactory <Map.Entry<K, V>> mapSetFactory(MapFactory<K, V> mf) static <K,V> SetFactory <Map.Entry<K, V>> multiMapSetFactory(MultiMapFactory<K, V> mf) Returns aSetFactorythat generatesMultiMapSetviews ofMultiMaps generated by the givenMultiMapFactory.static <V> CollectionFactory<V> static <V> CollectionFactory<V> Returns aCollectionFactorythat generates synchronized (thread-safe)Collections.static <V> ListFactory<V> Returns aListFactorythat generates synchronized (thread-safe)Lists.static <K,V> MapFactory <K, V> synchronizedMapFactory(MapFactory<K, V> mf) Returns aMapFactorythat generates synchronized (thread-safe)Maps.static <V> SetFactory<V> synchronizedSetFactory(SetFactory<V> sf) Returns aSetFactorythat generates synchronized (thread-safe)Sets.static final <K extends Comparable<K>,V>
MapFactory<K, V> Returns aMapFactorythat generatesTreeMaps, in the keys' natural order.static final <K,V> MapFactory <K, V> treeMapFactory(Comparator<? super K> comp) static final <V extends Comparable<V>>
SetFactory<V> Returns aSetFactorythat generatesTreeSets, in the elements' natural order.static final <V> SetFactory<V> treeSetFactory(Comparator<? super V> comp) static final <V> SetFactory<V> Deprecated.
-
Field Details
-
hashMapFactory
Deprecated.UsehashMapFactory(), which is parameterized.AMapFactorythat generatesHashMaps. -
linkedHashMapFactory
Deprecated.UselinkedHashMapFactory(), which is parameterized.AMapFactorythat generatesLinkedHashMaps.- Since:
- 1.3
-
hashSetFactory
Deprecated.UsehashSetFactory(), which is parameterized.ASetFactorythat generatesHashSets. -
linkedHashSetFactory
Deprecated.UselinkedHashSetFactory(), which is parameterized.ASetFactorythat generatesLinkedHashSets.- Since:
- 1.3
-
workSetFactory
Deprecated.ASetFactorythat generatesWorkSets. -
linearSetFactory
Deprecated.UselinearSetFactory(), which is parameterized. -
treeSetFactory
Deprecated.UsetreeSetFactory(), which is parameterized.ASetFactorythat generatesTreeSets. -
treeMapFactory
Deprecated.UsetreeMapFactory(), which is parameterized.AMapFactorythat generatesTreeMaps.- Since:
- 1.5
-
linkedListFactory
Deprecated.UselinkedListFactory(), which is parameterized.AListFactorythat generatesLinkedLists. -
arrayListFactory
Deprecated.UsearrayListFactory(), which is parameterized.Returns aListFactorythat generatesArrayLists.
-
-
Method Details
-
hashMapFactory
-
linkedHashMapFactory
Returns aMapFactorythat generatesLinkedHashMaps.- Since:
- 1.3
-
enumMapFactory
AMapFactorythat generatesEnumMaps.- Since:
- 1.3
-
hashSetFactory
-
linkedHashSetFactory
Returns aSetFactorythat generatesLinkedHashSets.- Since:
- 1.3
-
enumSetFactory
ASetFactorythat generatesEnumSets.- Since:
- 1.3
-
workSetFactory
Deprecated.ASetFactorythat generatesWorkSets. -
linearSetFactory
-
treeSetFactory
Returns aSetFactorythat generatesTreeSets, in the elements' natural order. -
treeSetFactory
- Since:
- 1.5
-
treeMapFactory
Returns aMapFactorythat generatesTreeMaps, in the keys' natural order.- Since:
- 1.5
-
treeMapFactory
- Since:
- 1.5
-
linkedListFactory
-
arrayListFactory
-
mapSetFactory
Returns aSetFactorythat generatesMapSetviews of maps generated by the givenMapFactory. These can be passed in as arguments to aGenericMultiMap, for example, to make a multimap of maps. -
multiMapSetFactory
Returns aSetFactorythat generatesMultiMapSetviews ofMultiMaps generated by the givenMultiMapFactory. These can be passed in as arguments to aGenericMultiMap, for example, to make a multimap of multimaps. -
synchronizedCollectionFactory
Returns aCollectionFactorythat generates synchronized (thread-safe)Collections. TheCollections generated are backed by theCollections generated bycf.- See Also:
-
synchronizedSetFactory
Returns aSetFactorythat generates synchronized (thread-safe)Sets. TheSets generated are backed by theSets generated bysf.- See Also:
-
synchronizedListFactory
Returns aListFactorythat generates synchronized (thread-safe)Lists. TheLists generated are backed by theLists generated bylf.- See Also:
-
synchronizedMapFactory
Returns aMapFactorythat generates synchronized (thread-safe)Maps. TheMaps generated are backed by theMapgenerated bymf.- See Also:
-
noNullCollectionFactory
-
arrayListFactory(), which is parameterized.