
biscotti
About
The Biscotti Project extends the http://code.google.com/p/google-collections/'>Google Collections Library (now part of http://code.google.com/p/guava-libraries/'>Guava) by offering new collection types, implementations, and related components for Java 6 or higher.
This project fully adheres to all the contracts and conventions specified in the JDK and Gauva.
What's in here?
Interfaces
- BoundedMap - A capacity restricted
Map
. The size of this map can vary, but never exceed the maximum number of entries (the bound) specified at creation.
- BoundedQueue - A capacity restricted
Queue
. The size of this queue can vary, but never exceed the maximum number of elements (the bound) specified at creation.
- SortedCollection - A collection whose elements are automatically sorted, either according to their natural ordering, or by a
Comparator
object. This interface is the root of all sorted collection interfaces and implementations.
- SortedList - A
List
that further provides a total ordering on its elements. This interface is theList
analog ofSortedSet
.
General-Purpose Implementations - TreeList - An implementation of the
SortedList
interface based on a modified Red-Black Tree.
- TreeQueue - A Red-Black Tree implementation of an unbounded priority
Queue
.
- TreeDeque - A Red-Black Tree implementation of an unbounded double-ended priority queue (also known as a
Deque
). ExtendsTreeQueue
.
- SkipList - A List which maintains its elements in sorted order while providing logarithmic running time for insertion, removal, and random access lookup operations, based on a modified Skip List.
- RankList - A List implementation optimized for efficient random access insertion and removal operations, based on a modified Skip List.
Special-Purpose Implementations - Capacity-restricted implementations. - TreeBoundedDeque - An implementation of
BoundedQueue
backed by aTreeDeque
. When this deque is full new elements are rejected or accepted based on their priority.
- LinkedBoundedQueue - A linked list implementation of
BoundedQueue
. This queue orders elements in first-in-first-out (FIFO) manner; it considers the eldest element to be the least-recently-inserted element.
- FIFOBoundedMap - A
BoundedMap
implementation which removes stale mappings in first-in-first-out order. ExtendsLinkedHashMap
.
- LRUBoundedMap - A
BoundedMap
implementation which removes stale mappings in least-recently-accessed order. ExtendsLinkedHashMap
.
Infrastructure - Collections3 - Convenient factory methods and synchronize and unmodifiable wrappes.
- Iterators2 - Offering count, concat, reverse, transform with function, filter with predicate, wrappers, and convenience implementations.
- Iterables2 - A sister class of
Iterators2
containing methods which operate exclusively onIterable
s.
- Preconditions2 - Static utility methods used to verify correctness of arguments passed to your own methods.
- CloneNotSupportedException - A runtime exception analogous to the checked
java.util.CloneNotSupportedException
.
Forwarding Implementations - Collections allowing you to customize their behavior per the decorator pattern without subclassing.
- ForwardingDeque - A
Deque
which forwards all its method calls to a backing deque.
- ForwardingNavigableMap - A
NavigableMap
which forwards all its method calls to a backing navigable map.
- ForwardingNavigableSet - A
NavigableSet
which forwards all its method calls to a backing navigable set.
- ForwardingPeekingIterator - A
PeekingIterator
which forwards all its method calls to a backing peeking iterator.
- ForwardingSortedList - A
SortedList
which forwards all its method calls to a backing sorted list.
Getting Started
It is assumed that you are familiar with the Java Collection Framework and the Google Guava Libraries. Please examine the Links section if you are not.
You can begin by reading the http://code.google.com/p/biscotti/wiki/FAQ'>FAQ, looking at the http://biscotti.googlecode.com/svn/trunk/javadoc/index.html'>API Documentation, and browsing the http://code.google.com/p/biscotti/source/browse/#svn/trunk/src/com/googlecode/biscotti'>source code.
A very early pre-alpha release is available for http://code.google.com/p/biscotti/downloads/list'>download. You will need to have the guava-r##.jar available in your project's classpath.
Coming Soon
Why should you be interested in this project? What are the advantages and disadvantages of using a TreeDeque
versus java.util.PriorityQueue
? A Tutorial is coming.
The next big thing I am working on is implementing a concurrent http://en.wikipedia.org/wiki/Skip_list'>Skip List based algorithm.
Project Information
- License: Apache License 2.0
- 8 stars
- svn-based source control
Labels:
Java
Collections
Iterators
Generics
Cache
Priority
PriorityQueue
RedBlackTree
LRU
PriorityDeque
Queue
Deque
Sorted
Ordered
Ordering