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

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

public class GroupPattern
extends Epc

Representation of an URI object containing a Grouping pattern.
Pattern codes may be in one of the following forms :

The difference from Epc class is that fields may have one of the following values : However, this class considers the URI in the following notation :
 'header':'type':'field_1'.'field_2'.'...etc'.'field_n'
Example for a given epc-tag URI :
 urn:epc:pat:sgtin-96:3.*.X.[40-50] 
Meaning that we have to group by CompanyPrefix the SGTINs having the FilterValue equal to 3, and the SerialNumber between 40 and 50 inclusive.
The URI will be decoded as follows: Finally, not all constructs are permitted, and this class assumes that the patterns are valid.


Field Summary
 
Fields inherited from class pops.ale.epc.spec.grouping.string.Epc
fields, header, type, uri
 
Constructor Summary
GroupPattern()
          Constructor
GroupPattern(java.lang.String patternUri)
          Constructor
 
Method Summary
static boolean areDisjoint(GroupPattern gPattA, GroupPattern gPattB)
          Disjointness of two patterns test.
static void main(java.lang.String[] args)
           
static boolean matches(Epc epc, GroupPattern patternGroup)
          Utility for testing if a given epc URI matches a grouping patern
 
Methods inherited from class pops.ale.epc.spec.grouping.string.Epc
dump, equals, getField, getFields, getHeader, getType, getUri, setUri, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupPattern

public GroupPattern(java.lang.String patternUri)
Constructor

Parameters:
patternUri -

GroupPattern

public GroupPattern()
Constructor

Method Detail

matches

public static boolean matches(Epc epc,
                              GroupPattern patternGroup)
Utility for testing if a given epc URI matches a grouping patern

Parameters:
epc - URI to match against group
patternGroup - to match
Returns:

areDisjoint

public static boolean areDisjoint(GroupPattern gPattA,
                                  GroupPattern gPattB)
Disjointness of two patterns test. It is defined as follows :
Let Pat_i and Pat_j be two pattern URIs, written as a series of fields as follows:
 Pat_i = urn:epc:pat:type_i:field_i_1.field_i_2.field_i_3...
 Pat_j = urn:epc:pat:type_j:field_j_1.field_j_2.field_j_3... 
Then Pat_i and Pat_j are disjoint if:

Parameters:
gPattA - Group pattern left
gPattB - Group pattern right
Returns:
true if disjoint, false otherwise

main

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