pops.ale.epc.spec.grouping.string
Class GroupOperator

java.lang.Object
  extended by pops.ale.epc.spec.grouping.string.GroupOperator

public class GroupOperator
extends java.lang.Object

This class represents a Group Operator implementation as defined in the ALE specification.
A group operator object wraps a list of disjoint grouping patterns (see addPattern(java.lang.String)).
The aim of this class is to provide a facility for generating a group name corresponding to an EPC (see group(Epc)).

See Also:
GroupPattern, Epc

Constructor Summary
GroupOperator()
          Constructor
 
Method Summary
 void addPattern(java.lang.String patternUri)
          Adds a grouping pattern to the group list.
 void cleanUp()
          cleanup function that erases all patterns from group.
 java.lang.String group(Epc epc)
          Gives the group name for a given epc code.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupOperator

public GroupOperator()
Constructor

Method Detail

addPattern

public void addPattern(java.lang.String patternUri)
                throws java.lang.IllegalArgumentException
Adds a grouping pattern to the group list.

Parameters:
patternGroup - The group pattern String to add.
Throws:
java.lang.IllegalArgumentException - if the given patternGroup is disjoint with the pattern group list

group

public java.lang.String group(Epc epc)
Gives the group name for a given epc code.

Parameters:
epc - code to match against a group pattern
Returns:
the group name or "default" if the epc code does not match any group pattern from the list

cleanUp

public void cleanUp()
cleanup function that erases all patterns from group. This permits to recycle objects.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception