com.spelunkcomputing.color
Class ColorRelation

java.lang.Object
  extended by com.spelunkcomputing.color.ColorRelation
All Implemented Interfaces:
java.io.Serializable

public abstract class ColorRelation
extends java.lang.Object
implements java.io.Serializable

ColorRelation defines an abstract class for producing other colors from a given base color. It also supports the reverse computation. A series of concrete sub-classes are defined as well.

See Also:
Serialized Form

Nested Class Summary
static class ColorRelation.Type
           
 
Method Summary
static ColorRelation create(ColorRelation.Type type)
          Factory method that creates a color relation of the specified type with the default number of colors.
static ColorRelation create(ColorRelation.Type type, int colorCount)
          Factory method that creates a color relation of the specified type with the specified number of colors.
 ColorRelation.Type getType()
          The Type of ColorRelation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ColorRelation create(ColorRelation.Type type)
Factory method that creates a color relation of the specified type with the default number of colors. If the type is AD_HOC the result will be null.

Parameters:
type - the type of color relation to create
Returns:
the newly created color relation

create

public static ColorRelation create(ColorRelation.Type type,
                                   int colorCount)
Factory method that creates a color relation of the specified type with the specified number of colors. If the type is AD_HOC the result will be null.

Parameters:
type - the type of color relation to create
colorCount - the number of colors in the relation
Returns:
the newly created color relation

getType

public ColorRelation.Type getType()
The Type of ColorRelation

Returns:
the type