infovis.metadata
Class ValueCategory

java.lang.Object
  extended by infovis.metadata.ValueCategory
All Implemented Interfaces:
Constants
Direct Known Subclasses:
ColorVisualizationFactory

public abstract class ValueCategory
extends Object
implements Constants

Qualify what the column values expresses.

A Column can contain values of five categories:

  1. Ordered: there is a natural ordering among the value, like integers
  2. Nominal: all the values are labels.
  3. Categorical: values are category names.
  4. Differential: there is a nominal value and the values are compared to it, like percentage of votes around 50%.
  5. Explicit: values are color encoded as ALPHA,RED,GREEN,BLUE

The representation of value should take the category into account. For example, coloring should be different: ordered values are usually depicted with intensity, nominal and categorical value with different hues, differential may use black for the the nominal value and to two other colors for above and below.

Controls for dynamic queries should also take the category into account. Range Sliders can be used with ordered value, differential and nominal values if that makes sense (an order can usually be derived from a nominal value, like lexicographical order, but this is somewhat artificial). For categorical value, radio shapes or other buttons can be used.

When nothing is known about a column, we assign it a category depending on its type.

Version:
$Revision: 1.7 $
Author:
Jean-Daniel Fekete

Field Summary
static String[] CATEGORY_NAME
          String names of integer categories.
static int TYPE_CATEGORIAL
          integer constant for categorical type.
static int TYPE_DIFFERENTIAL
          integer constant for differential type.
static int TYPE_EXPLICIT
          integer constant for explicit type.
static int TYPE_NOMINAL
          integer constant for nominal type.
static int TYPE_ORDERED
          integer constant for ordered type.
static int TYPE_UNKOWN
          integer constant for unkown type.
static String VALUE_CATEGORY_TYPE
          Key for the metadata.
static String VALUE_CATEGORY_TYPE_CATEGORICAL
          Values are categorical.
static String VALUE_CATEGORY_TYPE_DIFFERENTIAL
          Values are differential (for example, around 0).
static String VALUE_CATEGORY_TYPE_DIFFERENTIAL_REFERENCE
          When the VALUE_TYPE is differential, the reference value can be stored as the value of this metadata property.
static String VALUE_CATEGORY_TYPE_EXPLICIT
          Values are explicit color values.
static String VALUE_CATEGORY_TYPE_NOMINAL
          Value are nominal.
static String VALUE_CATEGORY_TYPE_ORDERED
          Values are ordered.
 
Fields inherited from interface infovis.metadata.Constants
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
 
Constructor Summary
ValueCategory()
           
 
Method Summary
static String categoryName(int cat)
          Returns the category name of a specified category.
static int categoryValue(String catString)
          Returns a value category given its category name.
static int findValueCategory(Column c)
          Returns a category constant associated with the specified column, guessing one is none is associated with the column.
static int getValueCategory(Column c)
          Returns the category constant associated with the specified column.
static String getValueCategoryString(Column c)
          Returns the category string associated with the specified column or null.
static void setValueCategory(Column c, int cat)
          Associates a value category to a column.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALUE_CATEGORY_TYPE

public static final String VALUE_CATEGORY_TYPE
Key for the metadata.

See Also:
Constant Field Values

VALUE_CATEGORY_TYPE_ORDERED

public static final String VALUE_CATEGORY_TYPE_ORDERED
Values are ordered.

See Also:
Constant Field Values

VALUE_CATEGORY_TYPE_NOMINAL

public static final String VALUE_CATEGORY_TYPE_NOMINAL
Value are nominal.

See Also:
Constant Field Values

VALUE_CATEGORY_TYPE_CATEGORICAL

public static final String VALUE_CATEGORY_TYPE_CATEGORICAL
Values are categorical.

See Also:
Constant Field Values

VALUE_CATEGORY_TYPE_DIFFERENTIAL

public static final String VALUE_CATEGORY_TYPE_DIFFERENTIAL
Values are differential (for example, around 0).

See Also:
Constant Field Values

VALUE_CATEGORY_TYPE_EXPLICIT

public static final String VALUE_CATEGORY_TYPE_EXPLICIT
Values are explicit color values.

See Also:
Constant Field Values

TYPE_UNKOWN

public static final int TYPE_UNKOWN
integer constant for unkown type.

See Also:
Constant Field Values

TYPE_ORDERED

public static final int TYPE_ORDERED
integer constant for ordered type.

See Also:
Constant Field Values

TYPE_NOMINAL

public static final int TYPE_NOMINAL
integer constant for nominal type.

See Also:
Constant Field Values

TYPE_CATEGORIAL

public static final int TYPE_CATEGORIAL
integer constant for categorical type.

See Also:
Constant Field Values

TYPE_DIFFERENTIAL

public static final int TYPE_DIFFERENTIAL
integer constant for differential type.

See Also:
Constant Field Values

TYPE_EXPLICIT

public static final int TYPE_EXPLICIT
integer constant for explicit type.

See Also:
Constant Field Values

CATEGORY_NAME

public static final String[] CATEGORY_NAME
String names of integer categories.


VALUE_CATEGORY_TYPE_DIFFERENTIAL_REFERENCE

public static final String VALUE_CATEGORY_TYPE_DIFFERENTIAL_REFERENCE
When the VALUE_TYPE is differential, the reference value can be stored as the value of this metadata property.

See Also:
Constant Field Values
Constructor Detail

ValueCategory

public ValueCategory()
Method Detail

getValueCategoryString

public static String getValueCategoryString(Column c)
Returns the category string associated with the specified column or null.

Parameters:
c - the column,
Returns:
the category string associated with the specified column or null if no category is associated with it.

getValueCategory

public static int getValueCategory(Column c)
Returns the category constant associated with the specified column.

Parameters:
c - the column.
Returns:
the category constant associated with the specified column or TYPE_UNKNOWN if no category is associated with it.

setValueCategory

public static void setValueCategory(Column c,
                                    int cat)
Associates a value category to a column.

Parameters:
c - the column
cat - the category

findValueCategory

public static int findValueCategory(Column c)
Returns a category constant associated with the specified column, guessing one is none is associated with the column.

Parameters:
c - the column
Returns:
a category constant associated with the specified column, guessing one is none is associated with the column.

categoryName

public static String categoryName(int cat)
Returns the category name of a specified category.

Parameters:
cat - the category
Returns:
the category name of a specified category

categoryValue

public static int categoryValue(String catString)
Returns a value category given its category name.

Parameters:
catString - the category name
Returns:
a value category given its category name.


Copyright 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.