TypedSeries is a special Series which can be contain only a single concept type.
When the type is Nil then the TypedSeries will be defined a Series.
Create the new entry for one "Person" concept and load data in it.
define TSeries [
static : main ( $args typeof Series ) [
$person = TypedSeries.create("TSeries:Person")
$person.createNewEntry
$person.lastEntry/firstName="Csaba"
$person.lastEntry/lastName="Szabo"
$person.lastEntry/address/city="Satu Mare"
$person.lastEntry/address/street@name="Aleea Humulesti"
$person.lastEntry/address/street@nr=12
$person.lastEntry/address/zipCode=3900
print $person.toXML]]
define TSeries:Person label "Person" [
firstName
lastName
address typeof TSeries:Address]
define TSeries:Address label "Address" [
city
street typeof TSeries:Street
zipCode]
define TSeries:Street label "Street" [
@name
@nr]
Attributes inherited from: Series
|
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI |
|
Methods inherited from: Series
IndexOf, add, contains, current, elementAt, getConceptElement, getConceptElements, insert, insert, next, previous, remove, remove, setIndex, setValue, sort, toTXT, toXML |
|
Label: | Has next |
Type: | Logical |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
Specify whenever the index represents the last element of the series or not.
Label: | Has previous |
Type: | Logical |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
Specify whenever the index represents the first element of the series or not.
Label: | Index |
Type: | Integer |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
Specify the current position of the cursor in the Series, also used to
move the cursor at the wanted position. Initially the index is
positioned at the first element of the TypedSeries.
Label: | Length |
Type: | Integer |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
Specify the number of items this TypedSeries contains.
Label: | Has next |
Type: | Logical |
Is Static: | false |
Is Hidden: | true |
Show Empty: | true |
Specify whenever the index represents the last element of the series or not.
Label: | Has previous |
Type: | Logical |
Is Static: | false |
Is Hidden: | true |
Show Empty: | true |
Specify whenever the index represents the first element of the series or
not.
Label: | Index |
Type: | Integer |
Is Static: | false |
Is Hidden: | true |
Show Empty: | true |
Specify the current position of the cursor in the Series, also used to
move the cursor at the wanted position. Initially the index is
positioned at the first element of the series.
Label: | Length |
Type: | Integer |
Is Static: | false |
Is Hidden: | true |
Show Empty: | true |
Specify the number of items this Series contains.
Parameters: |
$type : | A string which specifies this TypedSeries type. |
|
Creates a new TypedSeries of the specified type.
Parameters: |
$type : | A string which specifies this TypedSeries type. |
$values : | The values which this TypedSeries will contain. |
|
Creates a new TypedSeries of the specified type and with the given
values.
Parameters: |
$value : | The value to add. |
|
Adds the specified value to this TypedSeries.
define test7 [
static : main ( $args typeof Series ) [
$person = TypedSeries.create("test7:Person")
$prs typeof test7:Person
$prs/firstName="Csaba"
$prs/lastName="Szabo"
$prs/city="Satu Mare"
$person.addEntry( $prs )
print $person.toXML
]
]
define test7:Person label "Person" [
firstName
lastName
city
]
-- the result is --
<Person>
<firstName>Csaba</firstName>
<lastName>Szabo</lastName>
<city>Satu Mare</city>
</Person>
Creates a new instance with the default type and label and adds to this TypedSeries.
define test7 [
static : main ( $args typeof Series ) [
$person = TypedSeries.create("test7:Person")
$person.createNewEntry
$person.lastEntry/firstName="Csaba"
$person.lastEntry/lastName="Szabo"
$person.lastEntry/city="Satu Mare"
print $person.toXML
]
]
define test7:Person label "Person" [
firstName
lastName
city
]
-- the result is --
<Person>
<firstName>Csaba</firstName>
<lastName>Szabo</lastName>
<city>Satu Mare</city>
</Person>
Returns this TypedSeries type.
define test7 [
static : main ( $args typeof Series ) [
$person = TypedSeries.create("test7:Person")
print $person.getType
]
]
define test7:Person label "Person" [
firstName
lastName
city
]
-- the result is --
test7:Person
Returns the last concept in the typed series.
define test7 [
static : main ( $args typeof Series ) [
$person = TypedSeries.create("test7:Person")
$person.createNewEntry
print $person.lastEntry.getConceptType
]
]
define test7:Person label "Person" [
firstName
lastName
city
]
-- the result is --
test7:Person
Sets this TypedSeries type to the specified value.
define test7 [
static : main ( $args typeof Series ) [
$person = TypedSeries.create("test7:Person")
$person.setType("MyPerson")
print $person.getType
]
]
define test7:Person label "Person" [
firstName
lastName
city
]
-- the result is --
MyPerson