suvi.api.alg.attr
Class AbstractGraphLayoutAttrBuilder

java.lang.Object
  |
  +--javautils.collections.Algs
        |
        +--suvi.api.alg.attr.AbstractGraphLayoutAttrBuilder
All Implemented Interfaces:
GraphLayoutAttrBuilder

public abstract class AbstractGraphLayoutAttrBuilder
extends javautils.collections.Algs
implements GraphLayoutAttrBuilder

Abstract base for GraphLayoutAttrBuilders.


Field Summary
static javautils.fun.ObjectToObjectToObject AS_BOOLEAN
          Checks that the given value is a Boolean and then returns it.
static javautils.fun.ObjectToObjectToObject AS_DIMENSION
          Checks that the given value is a pair of non-negative integers and then returns a new Dimension-object whose width is the first element of the pair and height is the second element.
static javautils.fun.ObjectToObjectToObject AS_DOUBLE
          Checks that the given value is a Double and then returns it.
static javautils.fun.ObjectToObjectToObject AS_INTEGER
          Checks that the given value is an Integer and then returns it.
static javautils.fun.ObjectToObjectToObject AS_NON_NEGATIVE_DOUBLE
          Checks that the given value is a non-negative Double and then returns it.
static javautils.fun.ObjectToObjectToObject AS_NON_NEGATIVE_INTEGER
          Checks that the given value is a non-negative Integer and then returns it.
static javautils.fun.ObjectToObjectToObject AS_OBJECT
          Just returns the given value.
 
Fields inherited from class javautils.collections.Algs
EMPTY_ARRAY, EMPTY_LIST, EMPTY_MAP, EMPTY_SEQUENCE, EMPTY_SET
 
Fields inherited from interface suvi.api.alg.attr.GraphLayoutAttrBuilder
NULL
 
Constructor Summary
protected AbstractGraphLayoutAttrBuilder(java.util.Map keyToValueMap, java.lang.Object[] keys, javautils.fun.ObjectToObjectToObject keyValueToValueFun)
           
protected AbstractGraphLayoutAttrBuilder(java.util.Map keyToValueMap, javautils.fun.ObjectToObjectToObject keyValueToValueFun)
           
 
Method Summary
static javautils.fun.ObjectToObjectToObject asKeyConstant(java.util.Map keyToConstantMap)
          Checks the given value is a key of the map and then returns the value corresponding to the key in the map.
protected static java.awt.Dimension cloneDimension(java.lang.Object value)
          A new clone of the given value assumed to be a Dimension.
protected static java.lang.Object get(java.util.Map primaryMap, java.lang.Object primaryKey, java.util.Map secondaryMap, java.lang.Object secondaryKey)
           
 java.lang.Object[] globalKeys()
          The global attribute keys recognized by this builder.
protected  java.lang.Object key(java.lang.Object key, java.lang.Object nodeOrEdge)
          Override this method to change the key.
 java.lang.Object[] keys()
          The attribute keys recognized by this builder.
 GraphLayoutAttr newAttr()
          Calls newAttr(Map,Map).
protected abstract  GraphLayoutAttr newAttr(java.util.Map objToValueMapCopy, java.util.Map keyToValueMapCopy)
          Called by newAttr() to build attribute object.
 void setAttr(java.lang.Object key, java.lang.Object nodeOrEdge, java.lang.Object value)
          A simple Template Method [Gamma1995] that checks that the key is one of the keys(), then puts the (key(key, nodeOrEdge), value(key, value))-pair into a map.
 void setGlobalAttr(java.lang.Object globalKey, java.lang.Object value)
          A simple Template Method [Gamma1995] that checks that the key is one of the globalKeys(), then puts the (globalKey, value(globalKey, value))-pair into a map.
protected  java.lang.Object value(java.lang.Object key, java.lang.Object value)
          Override this method to change the value.
 
Methods inherited from class javautils.collections.Algs
addAll, allSuperInterfaces, asArray, asArray, asComparator, asUnmodifiableList, collect, collectMap, collectSet, collectUnmodifiable, concat, concat, concat, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOfArray, ensureLength, exists, exists, exists, filter, filter, filter, find, find, find, flatten, flatten, flatten, fold, fold, fold, foldRight, foldRight, foldRight, forAll, forAll, forAll, forEach, forEach, forEach, forEach, forEach, forEach, forEachInProduct, forEachInProduct, forEachInProduct, forEachInProduct, genAddAll, genConcat, genConcat, genForEach, genForEach, getOrIfNull, integersInRange, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iteratorOverArray, map, map, map, map, map, map, mapMorphism, mapMorphismTo, mapTransform, max, max, max, max, max, max, max, min, min, min, min, min, min, min, newMap, newShapedArray, newUnmodifiableList, putAll, putAll, reverseIterator, reverseIterator, select, select, select, sign, singletonIterator, sort, sort, sorted, sorted, transform, transform, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AS_OBJECT

public static final javautils.fun.ObjectToObjectToObject AS_OBJECT

Just returns the given value.


AS_INTEGER

public static final javautils.fun.ObjectToObjectToObject AS_INTEGER

Checks that the given value is an Integer and then returns it.


AS_NON_NEGATIVE_INTEGER

public static final javautils.fun.ObjectToObjectToObject AS_NON_NEGATIVE_INTEGER

Checks that the given value is a non-negative Integer and then returns it.


AS_DOUBLE

public static final javautils.fun.ObjectToObjectToObject AS_DOUBLE

Checks that the given value is a Double and then returns it.


AS_NON_NEGATIVE_DOUBLE

public static final javautils.fun.ObjectToObjectToObject AS_NON_NEGATIVE_DOUBLE

Checks that the given value is a non-negative Double and then returns it.


AS_BOOLEAN

public static final javautils.fun.ObjectToObjectToObject AS_BOOLEAN

Checks that the given value is a Boolean and then returns it.


AS_DIMENSION

public static final javautils.fun.ObjectToObjectToObject AS_DIMENSION

Checks that the given value is a pair of non-negative integers and then returns a new Dimension-object whose width is the first element of the pair and height is the second element.

Constructor Detail

AbstractGraphLayoutAttrBuilder

protected AbstractGraphLayoutAttrBuilder(java.util.Map keyToValueMap,
                                         javautils.fun.ObjectToObjectToObject keyValueToValueFun)

AbstractGraphLayoutAttrBuilder

protected AbstractGraphLayoutAttrBuilder(java.util.Map keyToValueMap,
                                         java.lang.Object[] keys,
                                         javautils.fun.ObjectToObjectToObject keyValueToValueFun)
Method Detail

globalKeys

public java.lang.Object[] globalKeys()
Description copied from interface: GraphLayoutAttrBuilder

The global attribute keys recognized by this builder.

Specified by:
globalKeys in interface GraphLayoutAttrBuilder

keys

public java.lang.Object[] keys()
Description copied from interface: GraphLayoutAttrBuilder

The attribute keys recognized by this builder.

Specified by:
keys in interface GraphLayoutAttrBuilder

setGlobalAttr

public final void setGlobalAttr(java.lang.Object globalKey,
                                java.lang.Object value)

A simple Template Method [Gamma1995] that checks that the key is one of the globalKeys(), then puts the (globalKey, value(globalKey, value))-pair into a map.

Specified by:
setGlobalAttr in interface GraphLayoutAttrBuilder

setAttr

public final void setAttr(java.lang.Object key,
                          java.lang.Object nodeOrEdge,
                          java.lang.Object value)

A simple Template Method [Gamma1995] that checks that the key is one of the keys(), then puts the (key(key, nodeOrEdge), value(key, value))-pair into a map.

Specified by:
setAttr in interface GraphLayoutAttrBuilder

key

protected java.lang.Object key(java.lang.Object key,
                               java.lang.Object nodeOrEdge)

Override this method to change the key. By default, the result is nodeOrEdge


value

protected java.lang.Object value(java.lang.Object key,
                                 java.lang.Object value)

Override this method to change the value.


newAttr

public final GraphLayoutAttr newAttr()

Calls newAttr(Map,Map).

Specified by:
newAttr in interface GraphLayoutAttrBuilder

newAttr

protected abstract GraphLayoutAttr newAttr(java.util.Map objToValueMapCopy,
                                           java.util.Map keyToValueMapCopy)

Called by newAttr() to build attribute object. The given maps are copies, so you can use them directly.


asKeyConstant

public static javautils.fun.ObjectToObjectToObject asKeyConstant(java.util.Map keyToConstantMap)

Checks the given value is a key of the map and then returns the value corresponding to the key in the map.


cloneDimension

protected static java.awt.Dimension cloneDimension(java.lang.Object value)

A new clone of the given value assumed to be a Dimension.


get

protected static java.lang.Object get(java.util.Map primaryMap,
                                      java.lang.Object primaryKey,
                                      java.util.Map secondaryMap,
                                      java.lang.Object secondaryKey)