nns
Class BioSensorRule

java.lang.Object
  extended by nns.BioSensorRule
All Implemented Interfaces:
java.lang.Comparable

public class BioSensorRule
extends java.lang.Object
implements java.lang.Comparable

Author:
martin lukac This is a simple class representing a simple implication logic rule The class behaves as a simple storage unit and comparator so as we can input either another rule for comparison, another String for comparison and/or String to be interpreted. Each rule is held in two parts: the if statement and the then statement; If statement is the part used to decode a query by match or not match the ELSE statement is the part to be returned and represents a valid command that can be fed directly to the moto--neuron center as a reflex or a simple command. To generate a simple logic rule the syntax is exactly the same as the simplified if-else statement: CONDITION ? EXECUTE IF TRUE : EXECUTE IF FALSE The evaluation has two possible settings: STRICT or RELAXED. STRICT forces an exact match of the condition to the submited statement (AND condition) RELAXED compares the statement element by element to the condition and if a single argument is equal returns TRUE and appropriate action (OR statement) CONDITION, EXECUTE IF TRUE and EXECUTE IF FALSE are in the MNS/NNS syntax

Constructor Summary
BioSensorRule(java.lang.String rule)
           
 
Method Summary
 int analyzeRule(java.lang.Object o)
           
 java.lang.String analyzeStatement(java.lang.Object o)
           
 int compareTo(java.lang.Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BioSensorRule

public BioSensorRule(java.lang.String rule)
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

analyzeRule

public int analyzeRule(java.lang.Object o)

analyzeStatement

public java.lang.String analyzeStatement(java.lang.Object o)
Parameters:
o - - object in the MNS command format
Returns:
- object in the MNS syntax