public interface BidiDecoration<K,V> extends Decoration<K,V>
Decoration
or
SettableDecoration
.
The behavior of implementations of this interface when a duplicate assignment is made (either two elements are assigned the same decoration, or one element is assigned to two decorations) is undefined. Implementors may choose to throw exceptions for either of these conditions, both, or neither.
The purpose of this interface is to provide a simple unifying mechanism
for accessing element (meta)data, which may be variously stored in
instance fields, auxiliary data structures such as Map
instances,
or the JUNG user data repository.
This interface is designed so as to be compatible with the BidiMap
interface--that is, so that a BidiMap
instance can serve as a Decoration
.
Examples of ways to instantiate this interface include:
BidiDecorationvertex_labels = new DualHashBidiMap (); BidiDecoration edge_ids = new BidiDecoration (BidiMap bm) { public Integer get(Edge e) { return bm.get(e); } public Edge getKey(Integer i) { return bm.getKey(i); } };
SettableDecoration
,
Decoration
,
SettableBidiDecoration
Modifier and Type | Method and Description |
---|---|
K |
getKey(V value)
Returns the key (element) associated with decoration
value . |
get