Class TdbFieldDesign
java.lang.Object
com.tietoenator.trip.jxp.database.TdbFieldDesign
- All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink
,Comparable<TdbFieldDesign>
public class TdbFieldDesign
extends Object
implements com.tietoenator.trip.jxp.internal.utils.DOMSink, Comparable<TdbFieldDesign>
Container and logic relating to a specific field within a database design
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor, creates a blank field designCopy constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the contents of the field design, reset all values to their default state.int
compareTo
(TdbFieldDesign field) Order this object with relation to another -- required to be able to sort a collection of these objects.void
copyFrom
(TdbFieldDesign src) Initialize this instance from the source providedboolean
Compares to another object; equality is defined by field number onlyRetrieve the name of the field in which the name or identifier of the copyright holder of the information contained within this field can be found.int
getCost()
Retrieve the field's cost, that is the unit cost that is reported in the server's debit logfile every time a user views the content of the field.Retrieve the function id that will be run to create default field content if no other values are provided.Retrieve the value that is applied to the field if no other values are provided.Retrieve any comment or description associated with the field designRetrieve the name of an ASE function called when scanning terms in this field during indexing.int
Retrieve the index mode of the field.Retrieve the name of an ASE function called when storing values in this field using the TFORM load utility (BAFFIT)int
Retrieve the maximum number of items (subfields / paragraphs) that the field can validly contain.int
Retrieve the minimum number of items (subfields / paragraphs) that the field can validly contain.getName()
Retrieve the name of the fieldint
Retrieve the field's unique IDRetrieve any restriction value associated with the field.getType()
Retrieve the type of the field, e.g.Retrieve the type of the field as an ID, therefore dialect-indepedentboolean
Check if this field's data restrictions are to be evaluated as a pattern (a regular expression).boolean
Check if this field's data restrictions are to be interpreted as a reference to a field in another database.boolean
Check if the index for this field should be constructed and stored separately from that for other fields within the database.boolean
Check if this field is included in non-Boolean text processing, e.g. similarity searching, classification, summarization, etc.boolean
Check if this field is indexed in any way.boolean
Check if the field is stored in original layout, or if TRIP will compress white space when storing field values.boolean
Check if this field is a member of the part record structureboolean
Check if this field is the part record name fieldboolean
Check if this field is the record name field, i.e. the record's primary keyboolean
Check if this field is the record number fieldboolean
isUnique()
Check if field values are to be validated for uniqueness.boolean
Check if the index for this (PHrase-only) field should consist of the phrase and its constituent words (false), or whether only the constituent words (true) should be indexed and not the containing phrase.void
Establish the name of the field in which the name or identifier of the copyright holder of the information contained within this field can be found.void
setCost
(int cost) Establish the field's cost, that is the unit cost that is reported in the server's debit logfile every time a user views the content of the field.void
Establish the function id that will be run to create default field content if no other values are provided.void
setDefaultValue
(String value) Establish the value that is to be applied to the field if no other values are provided.void
setDescription
(String comment) Establish a comment or description to be associated with the field designvoid
setFieldIndexed
(boolean mode) Establish whether the index for this field should be constructed and stored separately from that for other fields within the database.void
setIncludedInTextProcessing
(boolean mode) Establish whether this field is to be included in non-Boolean text processing, e.g. similarity searching, classification, summarization, etc.void
setIndexAse
(String ase) Establish the name of an ASE function to be called when scanning terms in this field during indexing.void
setIndexed
(boolean mode) Establish whether this field is indexed in any way.void
setIndexMode
(int mode) Establish the index mode of the field.void
setLoadAse
(String ase) Establish the name of an ASE function to be called when storing values in this field using the TFORM load utility (BAFFIT)void
setMaxItems
(int items) Establish the maximum number of items (subfields / paragraphs) that the field can validly contain.void
setMinItems
(int items) Establish the minimum number of items (subfields / paragraphs) that the field can validly contain.void
Establish the name of the fieldvoid
setNumber
(int nr) Assign the field's unique ID.void
setOriginalLayout
(boolean layout) Establish whether the field is to be stored in original layout, or if TRIP should compress white space when storing field values.void
setPartField
(boolean flag) Establish this field as belonging to the part record structurevoid
setPartNameField
(boolean flag) Establish whether this field is the part record name fieldvoid
setRecordNameField
(boolean flag) Establish whether this field is the record name field, i.e. the record's primary keyvoid
setRecordNumberField
(boolean flag) Establish whether this field is the record number fieldvoid
setRestriction
(String value) Establish a restriction value associated with the field.void
Establish the type of the field, e.g.void
setTypeId
(TdbFieldType typeId) Set the type of the field.void
setUnique
(boolean unique) Establish whether field values are to be validated for uniqueness.void
setUsesPattern
(boolean flag) Establish whether this field's data restrictions are to be evaluated as a pattern (a regular expression).void
setUsesReference
(boolean flag) Establish whether this field's data restrictions are to be interpreted as a reference to a field in another database.void
setWordIndexed
(boolean mode) Establish whether the index for this (PHrase-only) field should consist of the phrase and its constituent words (false), or whether only the constituent words (true) should be indexed and not the containing phrase.
-
Constructor Details
-
TdbFieldDesign
public TdbFieldDesign()Constructor, creates a blank field design -
TdbFieldDesign
Copy constructor- Parameters:
src
- Copy source
-
-
Method Details
-
getName
Retrieve the name of the field- Returns:
- Field name
-
setName
Establish the name of the field- Parameters:
name
- Field name
-
getType
Retrieve the type of the field, e.g. PHrase, TExt, etc.- Returns:
- Field type
-
setType
Establish the type of the field, e.g. PHrase, TExt, etc.- Parameters:
type
- Field type
-
getCopyrightHolderField
Retrieve the name of the field in which the name or identifier of the copyright holder of the information contained within this field can be found.- Returns:
- Copyright holder field, if any
-
setCopyrightHolderField
Establish the name of the field in which the name or identifier of the copyright holder of the information contained within this field can be found.- Parameters:
name
- Copyright holder field
-
getDescription
Retrieve any comment or description associated with the field design- Returns:
- Field comment, if any
-
setDescription
Establish a comment or description to be associated with the field design- Parameters:
comment
- Field comment
-
getRestriction
Retrieve any restriction value associated with the field. This value is either a simple list of valid values that the field may take, or an argument for a specific type of restriction, seegetUsesPattern
andgetUsesReference
.- Returns:
- Restriction value, if any
-
setRestriction
Establish a restriction value associated with the field. This value is either a simple list of valid values that the field may take, or an argument for a specific type of restriction, seegetUsesPattern
andgetUsesReference
.- Parameters:
value
- Restriction value
-
getUsesPattern
public boolean getUsesPattern()Check if this field's data restrictions are to be evaluated as a pattern (a regular expression). If this value is true, the string returned by the methodgetRestriction
is the pattern to which field values must conform.- Returns:
- true if field values must conform to a pattern
-
setUsesPattern
public void setUsesPattern(boolean flag) Establish whether this field's data restrictions are to be evaluated as a pattern (a regular expression). If this value is true, the string set by the methodsetRestriction
is the pattern to which field values must conform.- Parameters:
flag
- true if field values must conform to a pattern
-
getUsesReference
public boolean getUsesReference()Check if this field's data restrictions are to be interpreted as a reference to a field in another database. If this value is true, the string returned by the methodgetRestriction
is the name of the database and field (using the normal "Database.Field" syntax) where the list of valid values for this field can be found- Returns:
- true if field values must conform to values in another database
-
setUsesReference
public void setUsesReference(boolean flag) Establish whether this field's data restrictions are to be interpreted as a reference to a field in another database. If this value is true, the string set by the methodsetRestriction
is the name of the database and field (using the normal "Database.Field" syntax) where the list of valid values for this field can be found- Parameters:
flag
- true if field values must conform to values in another database
-
getLoadAse
Retrieve the name of an ASE function called when storing values in this field using the TFORM load utility (BAFFIT)- Returns:
- Load ASE name, if any
-
setLoadAse
Establish the name of an ASE function to be called when storing values in this field using the TFORM load utility (BAFFIT)- Parameters:
ase
- Load ASE name
-
getIndexAse
Retrieve the name of an ASE function called when scanning terms in this field during indexing.- Returns:
- Index ASE name, if any
-
setIndexAse
Establish the name of an ASE function to be called when scanning terms in this field during indexing.- Parameters:
ase
- Index ASE name
-
getDefaultValue
Retrieve the value that is applied to the field if no other values are provided. SeegetDefaultFunction
for more flexibility.- Returns:
- Default field value, if any
-
setDefaultValue
Establish the value that is to be applied to the field if no other values are provided. SeegetDefaultFunction
for more flexibility.- Parameters:
value
- Default field value
-
getDefaultFunction
Retrieve the function id that will be run to create default field content if no other values are provided.- Returns:
- Default field function, if any
-
setDefaultFunction
Establish the function id that will be run to create default field content if no other values are provided.- Parameters:
func
- Default field function
-
isOriginalLayout
public boolean isOriginalLayout()Check if the field is stored in original layout, or if TRIP will compress white space when storing field values. Only relevant to TExt fields.- Returns:
- true if the field is to be compressed.
-
setOriginalLayout
public void setOriginalLayout(boolean layout) Establish whether the field is to be stored in original layout, or if TRIP should compress white space when storing field values. Only relevant to TExt fields.- Parameters:
layout
- true if the field is to be compressed.
-
isUnique
public boolean isUnique()Check if field values are to be validated for uniqueness.- Returns:
- true if field values must be unique
-
setUnique
public void setUnique(boolean unique) Establish whether field values are to be validated for uniqueness.- Parameters:
unique
- true if field values must be unique
-
isRecordNameField
public boolean isRecordNameField()Check if this field is the record name field, i.e. the record's primary key- Returns:
- true if the field is the record name field
-
setRecordNameField
public void setRecordNameField(boolean flag) Establish whether this field is the record name field, i.e. the record's primary key- Parameters:
flag
- true if the field is the record name field
-
isRecordNumberField
public boolean isRecordNumberField()Check if this field is the record number field- Returns:
- true if the field is the record number field
-
setRecordNumberField
public void setRecordNumberField(boolean flag) Establish whether this field is the record number field- Parameters:
flag
- true if the field is the record number field
-
isPartNameField
public boolean isPartNameField()Check if this field is the part record name field- Returns:
- true if the field is the part record name field
-
setPartNameField
public void setPartNameField(boolean flag) Establish whether this field is the part record name field- Parameters:
flag
- true if the field is the part record name field
-
isPartField
public boolean isPartField()Check if this field is a member of the part record structure- Returns:
- true if this field is in the part record structure
-
setPartField
public void setPartField(boolean flag) Establish this field as belonging to the part record structure- Parameters:
flag
- true if this field is to be in the part record structure
-
getTypeId
Retrieve the type of the field as an ID, therefore dialect-indepedent- Returns:
- Field type ID
-
setTypeId
Set the type of the field.- Parameters:
typeId
- A TdbFieldType enum indicating the field type.
-
getIndexMode
public int getIndexMode()Retrieve the index mode of the field. Note that this is more easily interpreted using the methodsisIndexed
,isFieldIndexed
,isWordIndexed
, andisIncludedInTextProcessing
- Returns:
- Index mode
-
setIndexMode
public void setIndexMode(int mode) Establish the index mode of the field. Note that this is more easily modified using the methodssetIndexed
,setFieldIndexed
,setWordIndexed
, andsetIncludedInTextProcessing
- Parameters:
mode
- Index mode
-
isIndexed
public boolean isIndexed()Check if this field is indexed in any way.- Returns:
- true if the field is included in the index in some form
-
setIndexed
public void setIndexed(boolean mode) Establish whether this field is indexed in any way.- Parameters:
mode
- If this value is false, all indexing flags are removed for the field; if true, the field is enabled for indexing and the type of indexing can be further modified using other index-related methods.
-
isFieldIndexed
public boolean isFieldIndexed()Check if the index for this field should be constructed and stored separately from that for other fields within the database. This can help performance in certain circumstances, such as for code fields that store very commonly occuring terms as abbreviations, for example stock symbols, etc.- Returns:
- true if the field is setup for separate field-level indexing
-
setFieldIndexed
public void setFieldIndexed(boolean mode) Establish whether the index for this field should be constructed and stored separately from that for other fields within the database. This can help performance in certain circumstances, such as for code fields that store very commonly occuring terms as abbreviations, for example stock symbols, etc.- Parameters:
mode
- true if the field is to be setup for separate field-level indexing
-
isWordIndexed
public boolean isWordIndexed()Check if the index for this (PHrase-only) field should consist of the phrase and its constituent words (false), or whether only the constituent words (true) should be indexed and not the containing phrase. This is intended as a storage performance optimization for PHrase fields that contain single words.- Returns:
- true if the PHrase field is setup for word-level indexing
-
setWordIndexed
public void setWordIndexed(boolean mode) Establish whether the index for this (PHrase-only) field should consist of the phrase and its constituent words (false), or whether only the constituent words (true) should be indexed and not the containing phrase. This is intended as a storage performance optimization for PHrase fields that contain single words.- Parameters:
mode
- true if the PHrase field is setup for word-level indexing
-
isIncludedInTextProcessing
public boolean isIncludedInTextProcessing()Check if this field is included in non-Boolean text processing, e.g. similarity searching, classification, summarization, etc.- Returns:
- true if the field is included in text processing (TExt and PHrase only)
-
setIncludedInTextProcessing
public void setIncludedInTextProcessing(boolean mode) Establish whether this field is to be included in non-Boolean text processing, e.g. similarity searching, classification, summarization, etc.- Parameters:
mode
- true if the field is included in text processing (TExt and PHrase only)
-
getNumber
public int getNumber()Retrieve the field's unique ID- Returns:
- Field number
-
setNumber
public void setNumber(int nr) Assign the field's unique ID.- Parameters:
nr
- Field number Please note that a field's number is set by the server and can't be modified meaningfully.
-
getCost
public int getCost()Retrieve the field's cost, that is the unit cost that is reported in the server's debit logfile every time a user views the content of the field.- Returns:
- Unit cost
-
setCost
public void setCost(int cost) Establish the field's cost, that is the unit cost that is reported in the server's debit logfile every time a user views the content of the field.- Parameters:
cost
- Unit cost
-
getMinItems
public int getMinItems()Retrieve the minimum number of items (subfields / paragraphs) that the field can validly contain.- Returns:
- Minimum acceptable items
-
setMinItems
public void setMinItems(int items) Establish the minimum number of items (subfields / paragraphs) that the field can validly contain.- Parameters:
items
- Minimum acceptable items
-
getMaxItems
public int getMaxItems()Retrieve the maximum number of items (subfields / paragraphs) that the field can validly contain.- Returns:
- Maximum acceptable items
-
setMaxItems
public void setMaxItems(int items) Establish the maximum number of items (subfields / paragraphs) that the field can validly contain.- Parameters:
items
- Maximum acceptable items
-
copyFrom
Initialize this instance from the source provided- Parameters:
src
- Source from which to copy
-
clear
public void clear()Clear the contents of the field design, reset all values to their default state. -
equals
Compares to another object; equality is defined by field number only -
compareTo
Order this object with relation to another -- required to be able to sort a collection of these objects.- Specified by:
compareTo
in interfaceComparable<TdbFieldDesign>
- Parameters:
field
- The field to compare to the current; ordering is performed using the field number only- Returns:
- -1 if this field's number is lower than that on the provided object; +1 if this field's number is higher than that on the provided object; 0 if the field numbers are the same
-