DomainTable (class)
public DomainTable
Import from: CURL.GUI.STANDARD. Defined in package CURL.DATA-ACCESS.BASE.

Provide a mappings from a string to a Domain and back.

Description

The FileConnection stores metadata in CSV files. A DomainTable is used to obtain a Domain object from the string that appears on the domain column of the metadata table. The standard mappings are in default-domain-table but applet authors can provide alternative mappings if needed.

Constructors
default:Create a new DomainTable. The mapping from strings to domains is provided using keyword argument. For example, the default domain table is created as follows:

Example

{let public constant default-domain-table:DomainTable = 
    {DomainTable
        bool = {StandardBoolDomain},
        datetime = {StandardDateTimeDomain},
        date = {StandardDateDomain},
        time = {StandardTimeDomain},
        int = {StandardIntDomain},
        double = {StandardDoubleDomain},
        int64 = {StandardInt64Domain},
        string = {StandardStringDomain}
    }
}
Note that both the names and the domains must be unique.
constructor public {DomainTable.default ...}

Properties
domain-to-name:HashTable to map a Domain object to its name. This is provided to support conversion of an in-memory recordset into a CsvRecordSet. (See FileConnection.write-metadata.)
field protected DomainTable.domain-to-name:{HashTable-of Domain, String} ={new {HashTable-of Domain, String}}
name-to-domain:HashTable to map a name to a Domain object.
field protected DomainTable.name-to-domain:{HashTable-of String, Domain} ={new {HashTable-of String, Domain}}

Methods
get-domain:If name is known, return the corresponding Domain otherwise throw KeyNotFoundException.
public {DomainTable.get-domain
name:String,
error-if-missing?:bool = true
}:Domain
get-domain-iterator:Return an iterator of all Domains in this table.
public {DomainTable.get-domain-iterator}:{Iterator-of Domain}
get-matching-domain-name:Return the name of the first Domain in this DomainTable that is the same type as domain. Return null if none is found.
public {DomainTable.get-matching-domain-name domain:Domain}:#String
get-name:If domain is known, return the corresponding name otherwise throw KeyNotFoundException.
public {DomainTable.get-name domain:Domain}:String
get-name-iterator:Return an iterator of all of the name in this table.
public {DomainTable.get-name-iterator}:{Iterator-of String}
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize



Constructor Details
default (constructor)
public {DomainTable.default ...}

Create a new DomainTable. The mapping from strings to domains is provided using keyword argument. For example, the default domain table is created as follows:

Example

{let public constant default-domain-table:DomainTable = 
    {DomainTable
        bool = {StandardBoolDomain},
        datetime = {StandardDateTimeDomain},
        date = {StandardDateDomain},
        time = {StandardTimeDomain},
        int = {StandardIntDomain},
        double = {StandardDoubleDomain},
        int64 = {StandardInt64Domain},
        string = {StandardStringDomain}
    }
}
Note that both the names and the domains must be unique.




Property Details
domain-to-name (field)
protected DomainTable.domain-to-name:{HashTable-of Domain, String} ={new {HashTable-of Domain, String}}

HashTable to map a Domain object to its name. This is provided to support conversion of an in-memory recordset into a CsvRecordSet. (See FileConnection.write-metadata.)



name-to-domain (field)
protected DomainTable.name-to-domain:{HashTable-of String, Domain} ={new {HashTable-of String, Domain}}

HashTable to map a name to a Domain object.






Method Details
get-domain (method)
public {DomainTable.get-domain
name:String,
error-if-missing?:bool = true
}:Domain

If name is known, return the corresponding Domain otherwise throw KeyNotFoundException.

Description

If called with error-if-missing? = false and the name is not found a StandardStringDomain is returned.


get-domain-iterator (method)
public {DomainTable.get-domain-iterator}:{Iterator-of Domain}

Return an iterator of all Domains in this table.



get-matching-domain-name (method)
public {DomainTable.get-matching-domain-name domain:Domain}:#String

Return the name of the first Domain in this DomainTable that is the same type as domain. Return null if none is found.

Description

This is different from DomainTable.get-name, which looks for a matching instance.


get-name (method)
public {DomainTable.get-name domain:Domain}:String

If domain is known, return the corresponding name otherwise throw KeyNotFoundException.



get-name-iterator (method)
public {DomainTable.get-name-iterator}:{Iterator-of String}

Return an iterator of all of the name in this table.