org.friendularity.api.struct
Class NumericNode<NumType>

java.lang.Object
  extended by org.friendularity.api.struct.NumericNode<NumType>
All Implemented Interfaces:
NumericMapper<NumType>
Direct Known Subclasses:
MathExprNode

public abstract class NumericNode<NumType>
extends Object
implements NumericMapper<NumType>

Wrapper for an arbitrary numeric object. Currently allows the NumberMapper feature to be overridden by subclasses, but will prefer a delegate mapper if supplied.

Author:
Stu B.

Constructor Summary
NumericNode(int dim, NumType initNumObj)
           
 
Method Summary
protected  void clearResultCache()
           
 void doUpdate(org.cogchar.bind.symja.MathGate mathGate)
           
 NumType getOutputObject()
           
protected abstract  void readDoublesIntoBuf(org.cogchar.bind.symja.MathGate mathGate, double[] buffer)
          This is our fundamental binding of a type to the MathGate concept.
protected  void writeAnyNumericFromAnyDoublesBuf(NumType outObj, double[] buffer)
          Long-name and protected scope.
 void writeNumericFromDoublesBuf(NumType outObj, double[] buffer)
          Writes into an existing NumType from a double-buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericNode

public NumericNode(int dim,
                   NumType initNumObj)
Method Detail

getOutputObject

public NumType getOutputObject()

writeNumericFromDoublesBuf

public void writeNumericFromDoublesBuf(NumType outObj,
                                       double[] buffer)
Description copied from interface: NumericMapper
Writes into an existing NumType from a double-buffer. This function is decoupled from the identity of the node itself.

Specified by:
writeNumericFromDoublesBuf in interface NumericMapper<NumType>

writeAnyNumericFromAnyDoublesBuf

protected void writeAnyNumericFromAnyDoublesBuf(NumType outObj,
                                                double[] buffer)
Long-name and protected scope. This feature is needed only if the NumericNode does not have a mapper assigned to it.

Parameters:
outObj -
buffer -

readDoublesIntoBuf

protected abstract void readDoublesIntoBuf(org.cogchar.bind.symja.MathGate mathGate,
                                           double[] buffer)
This is our fundamental binding of a type to the MathGate concept. Reads our node's doubles from a mathGate into the given buffer.

Parameters:
mathGate -
buffer -

clearResultCache

protected void clearResultCache()

doUpdate

public void doUpdate(org.cogchar.bind.symja.MathGate mathGate)


Copyright © 2011-2014. All Rights Reserved.