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

All Known Subinterfaces:
BidiDecoration<K,V>, SettableBidiDecoration<K,V>, SettableDecoration<K,V>
All Known Implementing Classes:
TestMap

public interface Decoration<K,V>

An interface for read-only decorations of arbitrary elements. (This is a generalization of interfaces such as VertexPaintFunction and EdgeStringer in the JUNG 1.x libraries.) Does not place any constraints on the uniqueness of decorations; if you want a one-to-one mapping from elements to decorations, see BidiDecoration or SettableBidiDecoration.

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:

 Decoration vertex_stringer = new HashMap();
 Decoration unit_edge_weight = 
      new Decoration() 
      {
          public Integer get(Edge e) { return 1; }
      };
 

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

Method Summary
 V get(K key)
          Returns the decoration (value) associated with the specified element key.
 

Method Detail

get

V get(K key)
Returns the decoration (value) associated with the specified element key.