Click or drag to resize

PrefixGcpLengthTable Class

A implementation of a GcpLengthTable based on mapping a prefix to a length. Clients can use this class when they want to manage their own GCP length mappings. To use GS1 published data, see Gs1GcpLengthTable

For example, given the following table:

             PrefixGcpLengthTable t = new PrefixGcpLengthTable();
             t.add("999", 7);
             t.add("9998", 10);
             t.add("99712345", 8);
             
Then the following shows various GCP lengths returned by the table.
             t.gcpLength("9994567890123") ==> 7
             t.gcpLength("9998567890123") ==> 10
             t.gcpLength("9971234567890") ==> 8
             t.gcpLength("9971299999999") ==> UnknownGcpLengthException
             

Inheritance Hierarchy
SystemObject
  GS1.EPC.ApiPrefixGcpLengthTable
    GS1.EPC.ApiGs1GcpLengthTable

Namespace: GS1.EPC.Api
Assembly: epc-epconly (in epc-epconly.dll) Version: 2.1.0.28145 (2.1.0.0)
Syntax
C#
public class PrefixGcpLengthTable : GcpLengthTable

The PrefixGcpLengthTable type exposes the following members.

Constructors
 NameDescription
Public methodPrefixGcpLengthTableInitializes a new instance of the PrefixGcpLengthTable class
Top
Methods
 NameDescription
Public methodAdd Adds a mapping specifying that any GCP beginning with the specified prefix is of the specific length.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGcpLength(String) Lookup a GCP length
Public methodGcpLength(String, Int32) Lookup a GCP length, starting the lookup at a particular point in the key string
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
See Also