scratch.joshua.jung_2_0.decoration
Interface SettableBidiDecoration<K,V>

All Superinterfaces:
BidiDecoration<K,V>, Decoration<K,V>, SettableDecoration<K,V>

public interface SettableBidiDecoration<K,V>
extends BidiDecoration<K,V>, SettableDecoration<K,V>

An interface for readable and writeable one-to-one decorations of arbitrary elements. (This is similar to classes such as StringLabeller in the JUNG 1.x libraries.) Constrains the decorations to be unique (that is, each decoration may be used by only one element, and therefore the decorations uniquely identify the elements and vice versa). If you want an unconstrained mapping from elements to decorations, see 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:

 SettableBidiDecoration vertex_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); }
      };
 

Author:
Joshua O'Madadhain
See Also:
BidiDecoration, Decoration, SettableDecoration

Method Summary
 
Methods inherited from interface scratch.joshua.jung_2_0.decoration.BidiDecoration
getKey
 
Methods inherited from interface scratch.joshua.jung_2_0.decoration.Decoration
get
 
Methods inherited from interface scratch.joshua.jung_2_0.decoration.SettableDecoration
put
 
Methods inherited from interface scratch.joshua.jung_2_0.decoration.Decoration
get