| Constructor and Description |
|---|
Relation(Map<K,Set<V>> map,
Class<?> setCreator) |
Relation(Map<K,Set<V>> map,
Class<?> setCreator,
Comparator<V> setComparator) |
| Modifier and Type | Method and Description |
|---|---|
Relation<K,V> |
addAllInverted(Map<V,K> source) |
Relation<K,V> |
addAllInverted(Relation<V,K> source) |
void |
clear() |
Relation<K,V> |
cloneAsThawed()
Provides for the clone operation.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
Relation<K,V> |
freeze()
Freezes the object.
|
Set<V> |
get(Object key) |
Set<V> |
getAll(Object key) |
int |
hashCode()
Returns an integer hash code for this object.
|
boolean |
isEmpty() |
boolean |
isFrozen()
Determines whether the object has been frozen or not.
|
Set<K> |
keySet() |
Set<Map.Entry<K,V>> |
keyValueSet() |
Set<Map.Entry<K,Set<V>>> |
keyValuesSet() |
static <K,V> Relation<K,V> |
of(Map<K,Set<V>> map,
Class<?> setCreator) |
static <K,V> Relation<K,V> |
of(Map<K,Set<V>> map,
Class<?> setCreator,
Comparator<V> setComparator) |
V |
put(K key,
V value) |
V |
putAll(Collection<K> keys,
V value) |
V |
putAll(K key,
Collection<? extends V> values) |
void |
putAll(Map<? extends K,? extends V> t) |
void |
putAll(Relation<? extends K,? extends V> t) |
boolean |
remove(K key,
V value) |
Set<V> |
removeAll(Collection<K> toBeRemoved) |
Set<V> |
removeAll(K... keys) |
Set<V> |
removeAll(K key) |
boolean |
removeAll(K key,
Iterable<V> toBeRemoved) |
boolean |
removeAll(Relation<K,V> toBeRemoved) |
int |
size() |
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
Set<V> |
values() |
<C extends Collection<V>> |
values(C result) |
public static <K,V> Relation<K,V> of(Map<K,Set<V>> map, Class<?> setCreator, Comparator<V> setComparator)
public void clear()
public boolean containsKey(Object key)
public boolean containsValue(Object value)
public boolean equals(Object o)
Objecto must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be reflexive, symmetric, and transitive.
Also, no object reference other than null is equal to null.
The default implementation returns true only if this ==
o. See Writing a correct
equals method
if you intend implementing your own equals method.
The general contract for the equals and Object.hashCode() methods is that if equals returns true for
any two objects, then hashCode() must return the same value for
these objects. This means that subclasses of Object usually
override either both methods or neither of them.
equals in class Objecto - the object to compare this instance with.true if the specified object is equal to this Object; false otherwise.Object.hashCode()public int hashCode()
ObjectObject.equals(java.lang.Object) returns true must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode method
if you intend implementing your own hashCode method.
hashCode in class ObjectObject.equals(java.lang.Object)public boolean isEmpty()
public V putAll(K key, Collection<? extends V> values)
public V putAll(Collection<K> keys, V value)
public int size()
public <C extends Collection<V>> C values(C result)
public String toString()
ObjectgetClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString method
if you intend implementing your own toString method.
public boolean isFrozen()
Freezablepublic Relation<K,V> freeze()
Freezablepublic Relation<K,V> cloneAsThawed()
FreezablecloneAsThawed in interface Freezable<Relation<K,V>>public Set<V> removeAll(Collection<K> toBeRemoved)