java.lang.Object
com.pervasive.datarush.schema.FixedWidthMultiRecordTextSchema
- All Implemented Interfaces:
TextSchema
A schema for a text file containing records with different fixed-width
formats. Each record type is uniquely identified by name within the
schema. A means of identifying the type of a text record must be
provided so that a structured text reader can use the correct parser.
-
Constructor Summary
ConstructorsConstructorDescriptionFixedWidthMultiRecordTextSchema(RecordDiscriminator descriminator) Defines an empty fixed-width multi-record schema. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new record identifier for this schema.voiddefineRecordType(String name, FixedWidthTextRecord type) Defines a record type in the schema.getRecordType(String name) Gets the definition of the specified record type.intGets the number of record types defined in the schema.Gets the names of the record types defined in the schema.
-
Constructor Details
-
FixedWidthMultiRecordTextSchema
Defines an empty fixed-width multi-record schema. The specified descriminator is used to determine the actual record schema.An empty multi-record schema definition is not meaningful; it is expected that at least one record schema will be defined before the multi-record schema is used.
- Parameters:
descriminator- descriminator for determining which contained record schema to use for a record
-
-
Method Details
-
getTypeCount
public int getTypeCount()Gets the number of record types defined in the schema.- Returns:
- the number of defined types
-
getTypeNames
Gets the names of the record types defined in the schema.- Returns:
- a list of defined record types
-
defineRecordType
Defines a record type in the schema.No significance is placed on the order in which record types are defined. However, the record identifier is expected to return the index of the type as it appears in
getTypeNames().- Parameters:
name- the name associated with the record type. The name must be unique amongst all defined types.type- describes the record format for the record type
-
getRecordType
Gets the definition of the specified record type.- Parameters:
name- the identifier associated with the record type- Returns:
- the definition of the record type. If not defined
in the schema,
nullis returned.
-
createRecordIdentifier
Creates a new record identifier for this schema.- Returns:
- a record identifier for this schema
-