org.javimmutable.collections.listmap
Class JImmutableTreeListMap<K,V>

java.lang.Object
  extended by org.javimmutable.collections.listmap.AbstractJImmutableListMap<K,V>
      extended by org.javimmutable.collections.listmap.JImmutableTreeListMap<K,V>
Type Parameters:
K -
V -
All Implemented Interfaces:
Iterable<JImmutableMap.Entry<K,JImmutableList<V>>>, Cursorable<JImmutableMap.Entry<K,JImmutableList<V>>>, Insertable<JImmutableMap.Entry<K,V>>, JImmutableListMap<K,V>, Mapped<K,JImmutableList<V>>

@Immutable
public class JImmutableTreeListMap<K,V>
extends AbstractJImmutableListMap<K,V>

JImmutableListMap implementation that allows keys to be traversed in sorted order using a Comparator of the natural ordering of the keys if they implement Comparable.


Method Summary
protected  JImmutableListMap<K,V> create(JImmutableMap<K,JImmutableList<V>> map)
          Implemented by derived classes to create a new instance of the appropriate class.
static
<K extends Comparable<K>,V>
JImmutableTreeListMap<K,V>
of()
          Constructs an empty list map whose keys are sorted in their natural ordering.
static
<K,V> JImmutableTreeListMap<K,V>
of(Comparator<K> comparator)
          Constructs an empty list map using the specified Comparator.
 
Methods inherited from class org.javimmutable.collections.listmap.AbstractJImmutableListMap
assign, copyList, cursor, delete, deleteAll, emptyList, equals, find, get, getList, getValueOr, hashCode, insert, insert, insertInList, isEmpty, iterator, keysCursor, size, toString, valuesCursor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

of

public static <K extends Comparable<K>,V> JImmutableTreeListMap<K,V> of()
Constructs an empty list map whose keys are sorted in their natural ordering. The keys must implement Comparable.

Type Parameters:
K -
V -
Returns:

of

public static <K,V> JImmutableTreeListMap<K,V> of(Comparator<K> comparator)
Constructs an empty list map using the specified Comparator. Note that the Comparator MUST BE IMMUTABLE. The Comparator will be retained and used throughout the life of the map and its offspring and will be aggressively shared so it is imperative that the Comparator be completely immutable.

Parameters:
comparator -

create

protected JImmutableListMap<K,V> create(JImmutableMap<K,JImmutableList<V>> map)
Description copied from class: AbstractJImmutableListMap
Implemented by derived classes to create a new instance of the appropriate class.

Specified by:
create in class AbstractJImmutableListMap<K,V>
Returns:


Copyright © 2014 Burton Computer Corporation. All rights reserved.