nenok.va
Class FiniteVariable

java.lang.Object
  extended by nenok.va.FiniteVariable
All Implemented Interfaces:
Serializable, Comparable, Variable

public class FiniteVariable
extends Object
implements Variable, Comparable

This is a pre-implementation of the variable interface and represents variables with finite frames. Such variables are used (for example) in the context of semiring induced valuation algebras to represent configurations.

Version:
$LastChangedRevision: 559 $
$LastChangedDate: 2008-03-26 14:25:18 +0100 (Mi, 26 Mrz 2008) $
Author:
Marc Pouly
See Also:
Serialized Form

Constructor Summary
FiniteVariable(String name, String[] frame)
          Constructor:
 
Method Summary
 int compareTo(Object arg)
           
static int countConfigurations(FiniteVariable[] vars)
          Computes the number of configurations of the given variable array.
 boolean equals(Object o)
           
 String[] getFrame()
          Returns the frame of this discrete variable.
 int hashCode()
           
 String toString()
          Converts the current variable to a string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FiniteVariable

public FiniteVariable(String name,
                      String[] frame)
Constructor:

Parameters:
name - The name of the variable.
frame - The variable's possible values.
Method Detail

getFrame

public String[] getFrame()
Returns the frame of this discrete variable.

Returns:
The variable's frame.

countConfigurations

public static int countConfigurations(FiniteVariable[] vars)
Computes the number of configurations of the given variable array.

Parameters:
vars - An array of variables with finite frames.
Returns:
The number of configurations that can be built from the argument array.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object o)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

compareTo

public int compareTo(Object arg)
Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)

toString

public String toString()
Converts the current variable to a string.

Overrides:
toString in class Object
Returns:
The variable's string value.