at.ac.tuwien.infosys.sm4all.copal.api.processor
Class ProcessorAction

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.processor.ProcessorAction

public class ProcessorAction
extends java.lang.Object

Class which defines action which a ContextProcessor can process. The name and the input of processor action uniquely defines the ContextEventAction and its associated input ContextEventType using same values of ContextEventAction.getName() and ContextEventType.getName() respectively. Each action also can define the names of ContextEventType of ContextEvents returned by the ContextProcessor after processing a ContextEvent.

Author:
sanjin

Constructor Summary
ProcessorAction(java.lang.String name, java.lang.String input, java.lang.String... output)
          Creates an instance of ProcessorAction.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this ProcessorAction to the specified object.
 java.lang.String getInput()
          Returns the globally unique name of the input ContextEventType.
 java.lang.String getName()
           
 java.lang.String[] getOutput()
          Returns the globally unique name of the output ContextEventType.
 int hashCode()
          Returns hash code for this ProcessorAction.
 boolean hasOutput()
          Returns if this ProcessorAction produces a result.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessorAction

public ProcessorAction(java.lang.String name,
                       java.lang.String input,
                       java.lang.String... output)
Creates an instance of ProcessorAction. The name is the globally unique name of the ContextEventAction and cannot be null. The input is the globally unique name of the input ContextEventType and also cannot be null. The output are globally unique names of ContextEventTypes of ContextEvents returned by a ContextProcessor as result of processing this ProcessorAction. If output is null or an empty array then the ContextProcessor will not produce a result.

Parameters:
name - the globally unique name of the ContextEventAction.
input - the globally unique name of the input ContextEventType.
output - the globally unique names of output ContextEventTypes.
Throws:
java.lang.NullPointerException - if specified name or input is null.
java.lang.IllegalArgumentException - if specified name or input is an empty or blank string.
Method Detail

getName

public java.lang.String getName()
Returns:
the globally unique name of the ContextEventAction.

getInput

public java.lang.String getInput()
Returns the globally unique name of the input ContextEventType.

Returns:
the globally unique name of the input ContextEventType.

getOutput

public java.lang.String[] getOutput()
Returns the globally unique name of the output ContextEventType.

Returns:
the globally unique name of the output ContextEventType.

hasOutput

public boolean hasOutput()
Returns if this ProcessorAction produces a result.

Returns:
if this ProcessorAction produces a result.

hashCode

public int hashCode()
Returns hash code for this ProcessorAction. The hash code for a ProcessorAction object is computed as:
 name * 31 + input
 
using integer arithmetic.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this ProcessorAction.

equals

public boolean equals(java.lang.Object obj)
Compares this ProcessorAction to the specified object. The result is true if and only if the argument is not null and is a ProcessorAction object that has same name, input and output as this ProcessorAction.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the Object to compare this ProcessorAction against.
Returns:
true if ProcessorActions are equal; false otherwise.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.