org.fosstrak.capturingapp.util
Class Util

java.lang.Object
  extended by org.fosstrak.capturingapp.util.Util

public class Util
extends java.lang.Object

helper class to perform transformations on ECReports.

Author:
sawielan

Nested Class Summary
static interface Util.EPCSelector
          Simple interface that allows you to select an EPC programmatically (eg. raw-hex, tag,
 
Field Summary
static Util.EPCSelector DEFAULT_SELECTOR
          the default selector.
static Util.EPCSelector selectEPC
          selector that returns the epc .
static Util.EPCSelector selectRawDecimal
          selector that returns the raw decimal.
static Util.EPCSelector selectRawHex
          selector that returns the raw hex.
static Util.EPCSelector selectTag
          selector that returns the tag.
 
Constructor Summary
Util()
           
 
Method Summary
static java.util.List<org.fosstrak.ale.xsd.epcglobal.EPC> extractEPC(Util.EPCSelector selector, org.fosstrak.ale.xsd.ale.epcglobal.ECReport report)
          extracts EPC values from the report. when the selector is set to null, then the default selector will be chosen.
static java.util.List<org.fosstrak.ale.xsd.epcglobal.EPC> extractEPC(Util.EPCSelector selector, org.fosstrak.ale.xsd.ale.epcglobal.ECReports reports)
          extracts EPC values from the reports. when the selector is set to null, then the default selector will be chosen.
static java.util.List<org.fosstrak.ale.xsd.ale.epcglobal.ECReportGroupListMember> extractReportMembers(org.fosstrak.ale.xsd.ale.epcglobal.ECReport report)
          extracts all the members containing the EPCs from the report.
static java.util.List<org.fosstrak.ale.xsd.ale.epcglobal.ECReportGroupListMember> extractReportMembers(org.fosstrak.ale.xsd.ale.epcglobal.ECReports reports)
          extracts all the members containing the EPCs from the reports.
static boolean fromReader(java.lang.String readerName, org.fosstrak.ale.xsd.ale.epcglobal.ECReportGroupListMember member)
          checks if a member was retrieved by a given reader.
static java.lang.String printGroupMember(org.fosstrak.ale.xsd.ale.epcglobal.ECReportGroupListMember member)
          helper to prepare a nice pretty print of a group member of a ECReport.
static java.lang.String printReport(org.fosstrak.ale.xsd.ale.epcglobal.ECReport report)
          helper to prepare a nice pretty print of a whole ECReport.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectRawHex

public static final Util.EPCSelector selectRawHex
selector that returns the raw hex.


selectRawDecimal

public static final Util.EPCSelector selectRawDecimal
selector that returns the raw decimal.


selectTag

public static final Util.EPCSelector selectTag
selector that returns the tag.


selectEPC

public static final Util.EPCSelector selectEPC
selector that returns the epc .


DEFAULT_SELECTOR

public static final Util.EPCSelector DEFAULT_SELECTOR
the default selector.

Constructor Detail

Util

public Util()
Method Detail

fromReader

public static boolean fromReader(java.lang.String readerName,
                                 org.fosstrak.ale.xsd.ale.epcglobal.ECReportGroupListMember member)
checks if a member was retrieved by a given reader.

Parameters:
readerName - the name of the reader to check.
member - the member to inspect.
Returns:
true if read from the reader, false otherwise.

extractReportMembers

public static java.util.List<org.fosstrak.ale.xsd.ale.epcglobal.ECReportGroupListMember> extractReportMembers(org.fosstrak.ale.xsd.ale.epcglobal.ECReports reports)
extracts all the members containing the EPCs from the reports.

Parameters:
reports - the report to "digest".
Returns:
a list of members providing access to the EPC data.

extractReportMembers

public static java.util.List<org.fosstrak.ale.xsd.ale.epcglobal.ECReportGroupListMember> extractReportMembers(org.fosstrak.ale.xsd.ale.epcglobal.ECReport report)
extracts all the members containing the EPCs from the report.

Parameters:
report - the report to "digest".
Returns:
a list of members providing access to the EPC data.

extractEPC

public static java.util.List<org.fosstrak.ale.xsd.epcglobal.EPC> extractEPC(Util.EPCSelector selector,
                                                                            org.fosstrak.ale.xsd.ale.epcglobal.ECReports reports)
extracts EPC values from the reports. when the selector is set to null, then the default selector will be chosen.

Parameters:
selector - the selector selecting the matching EPCs.
reports - the reports from where to select the EPCs.
Returns:
returns a list of selected EPCs.

extractEPC

public static java.util.List<org.fosstrak.ale.xsd.epcglobal.EPC> extractEPC(Util.EPCSelector selector,
                                                                            org.fosstrak.ale.xsd.ale.epcglobal.ECReport report)
extracts EPC values from the report. when the selector is set to null, then the default selector will be chosen.

Parameters:
selector - the selector selecting the matching EPCs.
report - the report from where to select the EPCs.
Returns:
returns a list of selected EPCs.

printReport

public static java.lang.String printReport(org.fosstrak.ale.xsd.ale.epcglobal.ECReport report)
helper to prepare a nice pretty print of a whole ECReport.

Parameters:
report - the ECReport to print.
Returns:
a nice pretty print.

printGroupMember

public static java.lang.String printGroupMember(org.fosstrak.ale.xsd.ale.epcglobal.ECReportGroupListMember member)
helper to prepare a nice pretty print of a group member of a ECReport.

Parameters:
member - the member to print.
Returns:
a nice pretty print.


Copyright © 2009. All Rights Reserved.