Package net.cscott.jutil
package net.cscott.jutil
-
ClassDescriptionAbstractHeap<K,
V> AbstractHeapprovides a skeletal implementation of theHeapinterface, to minimize the effort required to implement this interface.AbstractMapEntry<K,V> AnAbstractMapEntrytakes care of most of the grunge work involved in subclassingMap.Entry.AbstractMultiMap<K,V> This class provides a skeletal implementation of theMultiMapinterface, to minimize the effort requires to implement this interface.AggregateMapFactory<K,V> AggregateMapFactoryuses a singleHashMapas backing store for the many smallerMaps created by thisMapFactory.AggregateSetFactoryuses a singleHashMapas backing store for the many smallerSets created by thisSetFactory.BinaryHeap<K,V> BinaryHeapis an implementation of a binary heap.BinaryTree<K>ABinaryTreeis aTreewhere each node has at most two children.BinomialHeap<K,V> ABinomialHeapallows O(lg n) time bounds for insert, minimum, extract-min, union, decrease-key, and delete operations.BitSetFactoryis aSetFactorythat, given a complete universe of possible values, produces low space overhead representations ofSets.Deprecated.CollectionFactoryis aCollectiongenerator.CollectionWrapperis a class that acts as a wrapper around another Collection, using it as its backing store.ACombineIteratorcombines several differentIterators into one.Defaultcontains one-off or 'standard, no-frills' implementations of simpleIterators,Collections, andComparators.Default.PairList<A,B> Deprecated.UsePair, an immutable record whosePair.left()andPair.right()replace the methods of the same name.DisjointSet<E>DisjointSetis an implementation of disjoint-set forests using the path compression and union-by-rank heuristics to achieve O(m * alpha(m, n)) runtime, where 'm' is the total number of operations, 'n' is the total number of elements in the set, and 'alpha' denotes the *extremely* slowly-growing inverse Ackermann function.Environment<K,V> AnEnvironmentis aMapwith scoping: you can save marks into the environment and undo all changes since a mark.A mark into an environment.Factoriesconsists exclusively of static methods that operate on or returnCollectionFactorys.FibonacciHeap<K,V> AFibonacciHeapallows amortized O(1) time bounds for create, insert, minimum, union, and decrease-key operations, and amortized O(lg n) run times for extract-min and delete.FilterIterator<A,B> AFilterIteratorfilters and maps a sourceIteratorto generate a new one: it returnsmap.apply(o)for each elementoof the source for whichfilter.test(o)is true.Deprecated.Use aPredicateand aFunction, which can be lambdas, withFilterIterator(Iterator,Predicate,Function),FilterIterator.filter(Iterator,Predicate)orFilterIterator.map(Iterator,Function).GenericInvertibleMap<K,V> GenericInvertibleMapis a default implementation ofInvertibleMap.GenericInvertibleMultiMapis a default implementation ofInvertibleMultiMap.GenericMultiMap<K,V> GenericMultiMapis a default implementation of aMultiMap.HashEnvironment<K,V> Heap<K,V> Heaps support create, insert, minimum, extract-min, union, decrease-key, and delete operations.Indexer<T>Indexeris an object for extracting unique indices for a set of objects.AnIntervalTreeis a mutable collection ofIntervalTree.Intervals.Immutable record representing a closed interval [low,high] holding an objectobj.InvertibleMap<K,V> AnInvertibleMapis an extension of theMapinterface to allow users to do reverse lookups on the mappings maintained.InvertibleMultiMap<K,V> AnInvertibleMultiMapis an extension of theMultiMapinterface to allow users to do reverse lookups on the mappings maintained.LinearMap<K,V> LinearSet<E>ListFactory<V>ListFactoryis aListgenerator.ListWrapper<E>ListWrapperis an abstract class designed to make it easier to write wrappers aroundLists.MapFactory<K,V> MapFactoryis aMapgenerator.MapSet<K,V> MapWrapper<K,V> MapWrapperis a class that acts as a proxy for another backing map, to allow for easy extension ofMapfunctionality while not restricting developers to one particularMapimplementation.MultiMap<K,V> MultiMapmaps a key to a collection of values.MultiMapFactory<K,V> MultiMapFactoryis aMultiMapgenerator.MultiMapSet<K,V> Pair<A,B> An immutable pair of values, either of which may benull.PairMapEntry<K,V> PairMapEntryis the easiest implementation of aMap.Entryever: a pair!PersistentMap<K,V> PersistentMapimplements a persistent map, based on a persistent randomized treap.PersistentMapFactory<K,V> APersistentMapFactoryuses hash-consing to ensure that theMaps created by it maximally reuse space.APersistentMultiMapFactoryuses hash-consing to ensure that theMultiMaps created by it maximally reuse space.PersistentSetimplements a persistent set, based on a persistent randomized treap.APersistentSetFactoryuses hash-consing to ensure that theSets created by it maximally reuse space.RedBlackTree<K>ARedBlackTreeis aBinaryTreethat uses red-black properties to maintain a balanced form.ReferenceUniqueis a property indicating that, for all instances of a class,(a==b)==(a.equals(b)).AReverseIteratoriterates through anIteratorin reverse order.ReverseListIteratortakes aListand gives you anIteratorthat traverses the list in reverse order.SetFactory<V>SetFactoryis aSetgenerator.SetWrapper<E>ASnapshotIteratortakes a "snapshot" of an iterator, and iterates over that snapshot.UniqueStack<E>TheUniqueStackclass represents a last-in-first-out stack of unique objects.UniqueVector<E>A unique vector refuses to addElement duplicates.Deprecated.UnmodifiableListIteratoris an abstract superclass to save you the trouble of implementing theUnmodifiableListIterator.remove(),UnmodifiableListIterator.add(Object)andUnmodifiableListIterator.set(Object)methods over and over again for those list iterators which don't implement them.UnmodifiableMap<K,V> UnmodifiableMapSet<K,V> UnmodifiableMapSetprevents mutation of a wrappedMapSet.UnmodifiableMultiMap<K,V> UnmodifiableMultiMapis an abstract superclass to save developers the trouble of implementing the various mutator methds of theMultiMapinterface.UnmodifiableMultiMapSetprevents mutation of a wrappedMultiMapSet.Miscellaneous static utility functions.TheVersionobject contains fields naming the current version of the jutil library (2.0).WorkSet<E>Deprecated.UseLinkedHashSetinstead.
BitSet, which grows as needed:firstSet(where)isnextSetBit(where+1), andlastSet(where)ispreviousSetBit(where-1);setUpTo(bit)isset(0, bit+1), andclearUpTo(bit)isclear(0, bit+1);setAll()isset(0, n)for a sizen;clearAll()isclear();intersectionEmpty(o)is!intersects(o);isZero()isisEmpty();copyBits(o)isclear()thenor(o);numberOfOnes()iscardinality(), andnumberOfOnes(where)isget(0, where+1).cardinality();or_upTo(o, bit)isor(o.get(0, bit+1)).