public interface SettableBidiDecoration<K,V> extends BidiDecoration<K,V>, SettableDecoration<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 Map
interface--that is, so that a Map
instance can serve as a Decoration
.
Examples of ways to instantiate this interface include:
SettableBidiDecorationvertex_labels = new DualHashBidiMap (); SettableBidiDecoration edge_ids = new SettableBidiDecoration (BidiMap bm) { public Integer get(Edge e) { return bm.get(e); } public Edge getKey(Integer i) { return bm.getKey(i); } public Integer put(Edge e, Integer i) { return bm.put(e, i); } };
BidiDecoration
,
Decoration
,
SettableDecoration
getKey
put
get