com.almende.eve.agent.example
Class CalcAgent

java.lang.Object
  extended by com.almende.eve.agent.Agent
      extended by com.almende.eve.agent.example.CalcAgent
All Implemented Interfaces:
AgentInterface

public class CalcAgent
extends Agent


Constructor Summary
CalcAgent()
           
 
Method Summary
 String eval(String expr)
          Evaluate given expression For example expr="2.5 + 3 / sqrt(16)" will return "3.25"
 String getDescription()
          Retrieve a description of the agents functionality
 String getVersion()
          Retrieve the agents version number
 
Methods inherited from class com.almende.eve.agent.Agent
clear, create, createAgentProxy, delete, destroy, finalize, getAgentFactory, getContext, getId, getMethods, getScheduler, getState, getType, getUrls, init, onSubscribe, onTrigger, onUnsubscribe, send, send, send, send, sendAsync, sendAsync, setAgentFactory, setState, subscribe, toString, trigger, unsubscribe, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CalcAgent

public CalcAgent()
Method Detail

eval

public String eval(String expr)
            throws Exception
Evaluate given expression For example expr="2.5 + 3 / sqrt(16)" will return "3.25"

Parameters:
expr -
Returns:
result
Throws:
Exception

getVersion

public String getVersion()
Description copied from interface: AgentInterface
Retrieve the agents version number

Specified by:
getVersion in interface AgentInterface
Specified by:
getVersion in class Agent
Returns:
version

getDescription

public String getDescription()
Description copied from interface: AgentInterface
Retrieve a description of the agents functionality

Specified by:
getDescription in interface AgentInterface
Specified by:
getDescription in class Agent
Returns:
description


Copyright © 2013 Almende BV. All Rights Reserved.