es.upv.dsic.gti_ia.core
Class MessageFilter

java.lang.Object
  extended by es.upv.dsic.gti_ia.core.MessageFilter
All Implemented Interfaces:
Cloneable

public class MessageFilter
extends Object
implements Cloneable

Class used to represent a filter for messages. By using this filter the user will be able to process only those messages they desire.


Constructor Summary
MessageFilter(String expr)
          Creates a filter tree from the given expression.
 
Method Summary
 Object clone()
          Creates a replica of this object by calling object.clone() of itself.
 boolean compareHeaders(ACLMessage msg)
          The evaluation method.
 String getExpression()
          Gets The expression for which this object can create the filter.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageFilter

public MessageFilter(String expr)
Creates a filter tree from the given expression.

Parameters:
expr - A String containing the expression.
Method Detail

clone

public Object clone()
Creates a replica of this object by calling object.clone() of itself.

Overrides:
clone in class Object

compareHeaders

public boolean compareHeaders(ACLMessage msg)
The evaluation method. The filter is compared against the message in this method.

Parameters:
msg - The message to compare.
Returns:
True if the message satisfies the filter. False otherwise.

getExpression

public String getExpression()
Gets The expression for which this object can create the filter.

Returns:
The String containing the expression.


Copyright © 2012 GTI-IA. All Rights Reserved.