net.sf.myra.datamining.data
Enum Operator

java.lang.Object
  extended by java.lang.Enum<Operator>
      extended by net.sf.myra.datamining.data.Operator
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Operator>

public enum Operator
extends java.lang.Enum<Operator>
implements java.lang.Cloneable

This enum represents an operator in a rule's antecedent term.

Version:
$Revision: 2359 $ $Date:: 2011-04-14 16:21:10#$
Author:
Fernando Esteban Barril Otero

Enum Constant Summary
EQUAL_TO
           
GREATER_THAN
           
GREATER_THAN_EQUAL_TO
           
IN_RANGE
           
LESS_THAN
           
LESS_THAN_EQUAL_TO
           
NOT_EQUAL_TO
           
 
Method Summary
abstract  boolean evaluate(double attribute, double... values)
          Verifies if the condition represented by this operatos is satisfied by the specified values.
protected  double precision(double value)
          Returns the double value with up to two decimal digits.
abstract  java.lang.String toString(java.lang.String attribute, double[] values, java.lang.String[] description)
          Returns the string representation of this operator condition.
static Operator valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Operator[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

EQUAL_TO

public static final Operator EQUAL_TO

NOT_EQUAL_TO

public static final Operator NOT_EQUAL_TO

LESS_THAN

public static final Operator LESS_THAN

LESS_THAN_EQUAL_TO

public static final Operator LESS_THAN_EQUAL_TO

GREATER_THAN

public static final Operator GREATER_THAN

GREATER_THAN_EQUAL_TO

public static final Operator GREATER_THAN_EQUAL_TO

IN_RANGE

public static final Operator IN_RANGE
Method Detail

values

public static Operator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Operator c : Operator.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Operator valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

evaluate

public abstract boolean evaluate(double attribute,
                                 double... values)
Verifies if the condition represented by this operatos is satisfied by the specified values.

Parameters:
attribute - the attribute value.
values - the condition values.
Returns:
true is the attribute value satisfies the operator condition; false otherwise.

toString

public abstract java.lang.String toString(java.lang.String attribute,
                                          double[] values,
                                          java.lang.String[] description)
Returns the string representation of this operator condition.

Parameters:
attribute - the attribute name.
values - the condition values.
Returns:
the string representation of this operator condition.

precision

protected final double precision(double value)
Returns the double value with up to two decimal digits. This is only used to output the value as a string (for readability).

Parameters:
value - the value to be converted.
Returns:
the double value with up to four decimal digits.


Copyright © 2013. All Rights Reserved.