clarion.common
Class Feature

java.lang.Object
  extended byclarion.common.Feature
All Implemented Interfaces:
java.lang.Cloneable

public class Feature
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
protected  double[] activations
          activation of each value in feature.
protected  boolean flag
          used for WM item.
protected  Global global
          gloabl settings.
protected  java.lang.String label
          the label of the feature.
protected  short length
          the length of this feature.
protected  short order
          order in the whole feature list.
protected  short type
          the type of the feature.
protected  short[] values
          the active values this feature has.
 
Constructor Summary
Feature(java.lang.String label, int length, int value)
          constructor used for WM flags.
Feature(java.lang.String label, short type, short order, double[] actVals, Global g)
          constructor.
Feature(java.lang.String label, short type, short order, short[] con, Global g)
          constructor.
Feature(java.lang.String label, short type, short order, short length, short[] vals, Global g)
          constructor.
 
Method Summary
 java.lang.Object clone()
          methods from class Object
 boolean equals(java.lang.Object other)
          methods from class Object
 double[] getActivations()
          returns the activations.
 void getActivations(double[] vals)
          returns the activations.
 short[] getContent()
          returns the content in terms of an array where each element indicates the corresponding dimensional value is active or not.
 void getContent(short[] content)
          return the content in terms of an array where each element indicates the corresponding dimensional value is active or not.
 java.lang.String getLabel()
          returns the feature label.
 int getLength()
          returns the feature length.
 int getOrder()
          returns the feature order.
 int getType()
          returns the feature type.
 int getValueNum()
          returns the number of active values.
 short[] getValues()
          returns active values.
 void getValues(short[] vals)
          returns the active values.
 int hashCode()
          methods from class Object
 boolean isContained(Feature other)
          returns if this feature is contained in other feature.
 boolean isTheSameFeature(Feature other)
          Compares two features is the same or not.
 void setValues(short[] arr)
          returns the activations.
 java.lang.String toString()
          methods from class Object
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

global

protected Global global
gloabl settings.


label

protected java.lang.String label
the label of the feature.


type

protected short type
the type of the feature.


order

protected short order
order in the whole feature list.


length

protected short length
the length of this feature.


values

protected short[] values
the active values this feature has.


activations

protected double[] activations
activation of each value in feature.


flag

protected boolean flag
used for WM item.

Constructor Detail

Feature

public Feature(java.lang.String label,
               int length,
               int value)
constructor used for WM flags.


Feature

public Feature(java.lang.String label,
               short type,
               short order,
               short[] con,
               Global g)
constructor.

Parameters:
label - the feature label.
type - the feature type.
order - the order in the chunk this feature is in.
con - the content of the feature in terms of an array where each element indicates a dimensional value is active or not.

Feature

public Feature(java.lang.String label,
               short type,
               short order,
               double[] actVals,
               Global g)
constructor.

Parameters:
label - the feature label.
type - the feature type.
order - the order in the chunk this feature is in.
actVals - the content of the feature in terms of an array of activations each value in the dimension has.

Feature

public Feature(java.lang.String label,
               short type,
               short order,
               short length,
               short[] vals,
               Global g)
constructor.

Parameters:
label - the feature label.
type - the feature type.
order - the order in the chunk this feature is in.
length - the length of the dimension.
vals - the content of the feature in terms of an array of active values this feature has.
Method Detail

isTheSameFeature

public boolean isTheSameFeature(Feature other)
Compares two features is the same or not.


getLabel

public java.lang.String getLabel()
returns the feature label.

Returns:
the feature label.

getType

public int getType()
returns the feature type.

Returns:
the feature type.

getOrder

public int getOrder()
returns the feature order.

Returns:
the feature order.

getLength

public int getLength()
returns the feature length.

Returns:
the feature length.

getValueNum

public int getValueNum()
returns the number of active values.

Returns:
the number of active values.

getValues

public short[] getValues()
returns active values.

Returns:
active values.

getValues

public void getValues(short[] vals)
returns the active values.

Parameters:
vals - the array to store the active values.

getContent

public short[] getContent()
returns the content in terms of an array where each element indicates the corresponding dimensional value is active or not.

Returns:
the content of this feature.

getContent

public void getContent(short[] content)
return the content in terms of an array where each element indicates the corresponding dimensional value is active or not.

Parameters:
content - the array to store the content of this feature.

getActivations

public double[] getActivations()
returns the activations.

Returns:
the activations.

getActivations

public void getActivations(double[] vals)
returns the activations.

Returns:
vals the array to store the activations.

setValues

public void setValues(short[] arr)
returns the activations.

Returns:
vals the array to store the activations.

isContained

public boolean isContained(Feature other)
returns if this feature is contained in other feature.


toString

public java.lang.String toString()
methods from class Object


hashCode

public int hashCode()
methods from class Object


equals

public boolean equals(java.lang.Object other)
methods from class Object


clone

public java.lang.Object clone()
methods from class Object