|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.neu.ccs.demeterf.lib.Map<Key,Val>
public class Map<Key,Val>
Represents a Map of comparable Keys to any old Values, implemented with RBTrees.
The Key requires a Comparator
Nested Class Summary | |
---|---|
static class |
Map.Merge<Val>
Function Class to help in the merging of Maps. |
static class |
Map.Transform<X,Y>
Trnasformer for Values o fa given Map |
static class |
Map.tree
Field Class |
Constructor Summary | |
---|---|
Map(List<Entry<Key,Val>> l)
Create a Map from the given list of Entries. |
|
Map(RBTree<Entry<Key,Val>> t)
Create a Map from the given RBTree of Entries. |
Method Summary | ||
---|---|---|
boolean |
containsKey(Key k)
Does this Map contain the given Key? |
|
static
|
create()
Create an Empty Map of *Comparable* Elements. |
|
static
|
create(java.util.Comparator<Key> c)
Create an Empty Map using the given Comparator to compare elements. |
|
static
|
create(List<Entry<Key,Val>> l)
Create a Map from the given list of Entries, with Comparable Keys. |
|
static
|
create(List<Entry<Key,Val>> l,
java.util.Comparator<Key> c)
Create a Map from the given list of Entries, with the given Comparator. |
|
static
|
create(List<Key> ks,
List<Val> vs)
Create a Map from the given list of Entries using the given Comparator. |
|
static
|
create(List<Key> ks,
List<Val> vs,
java.util.Comparator<Key> c)
Create a Map from the given list of Entries using the given Comparator. |
|
Val |
get(Key k)
Get the Value that the given Key is mapped to. |
|
int |
hashCode()
Retur this Maps HashCode |
|
static
|
hashMap()
Create a Map that uses Hashcode to compare Keys. |
|
static
|
hashMap(List<Entry<Key,Val>> l)
Create a Map from the given Entry List that uses Hashcode to compare Keys. |
|
static
|
hashMap(List<Key> ks,
List<Val> vs)
Create a Map from the given Key and Value Lists that uses Hashcode to compare Keys. |
|
boolean |
isEmpty()
Is this Map Empty? |
|
java.util.Iterator<Entry<Key,Val>> |
iterator()
Return an Iterator over the Entries in this Map, in Key order. |
|
List<Key> |
keys()
Reutrn a List of the Keys contained in this Map. |
|
Map<Key,Val> |
merge(Key k,
Val v,
Map.Merge<Val> m)
Merge the given Map into this one, using the given Merge function object to merge the elements of matching Keys |
|
Map<Key,Val> |
merge(Map<Key,Val> s)
Merge the given Map into this one, ignoring duplicate mappings. |
|
Map<Key,Val> |
merge(Map<Key,Val> s,
Map.Merge<Val> m)
Merge the given Map into this one, using the given Merge function object to merge the elements of matching Keys |
|
Map<Key,Val> |
put(Key k,
Val v)
Return a new Map with the given Mapping (Entry) added. |
|
Map<Key,Val> |
remap(Key k,
Val v)
Return a new Map with the given Mapping added or updated if it exists. |
|
Map<Key,Val> |
remove(Key k)
Return a new Map that does not include the given key |
|
int |
size()
Return the number of elements in this Map |
|
java.util.Map<Key,Val> |
toJavaMap()
Convert this Map into a java.util.Map |
|
List<Entry<Key,Val>> |
toList()
Return all the Entries in this Map as a list, in Key order. |
|
java.lang.String |
toString()
Produce a String representation of this Map. |
|
java.lang.String |
toTreeString()
Produce a String representation of this Map. |
|
|
transformValues(List.Map<Val,NVal> t)
Transform Each of the Keys |
|
List<Val> |
values()
Reutrn a List of the Values contained in this Map. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Map(List<Entry<Key,Val>> l)
public Map(RBTree<Entry<Key,Val>> t)
Method Detail |
---|
public <NVal> Map<Key,NVal> transformValues(List.Map<Val,NVal> t)
public static <Key extends java.lang.Comparable<Key>,Val> Map<Key,Val> create()
public static <Key,Val> Map<Key,Val> create(java.util.Comparator<Key> c)
public static <Key extends java.lang.Comparable<Key>,Val> Map<Key,Val> create(List<Entry<Key,Val>> l)
public static <Key,Val> Map<Key,Val> create(List<Entry<Key,Val>> l, java.util.Comparator<Key> c)
public static <Key extends java.lang.Comparable<Key>,Val> Map<Key,Val> create(List<Key> ks, List<Val> vs)
public static <Key,Val> Map<Key,Val> create(List<Key> ks, List<Val> vs, java.util.Comparator<Key> c)
public static <Key,Val> Map<Key,Val> hashMap()
public static <Key,Val> Map<Key,Val> hashMap(List<Entry<Key,Val>> l)
public static <Key,Val> Map<Key,Val> hashMap(List<Key> ks, List<Val> vs)
public int size()
public boolean containsKey(Key k)
public boolean isEmpty()
public Map<Key,Val> put(Key k, Val v)
public Map<Key,Val> remap(Key k, Val v)
public Val get(Key k)
public Map<Key,Val> remove(Key k)
public Map<Key,Val> merge(Map<Key,Val> s)
public Map<Key,Val> merge(Map<Key,Val> s, Map.Merge<Val> m)
public Map<Key,Val> merge(Key k, Val v, Map.Merge<Val> m)
public List<Key> keys()
public List<Val> values()
public List<Entry<Key,Val>> toList()
public java.util.Iterator<Entry<Key,Val>> iterator()
iterator
in interface java.lang.Iterable<Entry<Key,Val>>
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toTreeString()
public java.util.Map<Key,Val> toJavaMap()
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |