mn8 Language Reference | Index    

Element

SUMMARY: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTORS SUMMARY  NO OPERATORS  METHODS SUMMARYDETAIL: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTOR DETAILS  NO OPERATORS  METHOD DETAILS

Description

Elements represent the building blocks of everything in MN8. An element is a primary data type which can have attributes and it's values can be a Concept (basically everything).

Usage

        $elem TYPEOF Element
        $attr = Attribute.create("name", "jon")
        $elem.addAttribute( $attr )
        $elem.setValue("employee of the year")
        PRINT $elem

                name: jon
                employee of the year

        PRINT $elem.toXML
            < name="jon">employee of the yea</>

        $elem.setLabel("employee")
        PRINT $elem
            employee
                name: jon
                employee of the year

        PRINT $elem.toXML
            <employee name="jon">employee of the year</employee>

Version: 0.1
Authors:Remus Pereni (http://neuro.nolimits.ro)
Inherits: Concept

Constructor List

create (String $label, Concept $value)
top

Method List

addAttribute (Attribute $attr)
addAttribute (String $name, String $label, Concept $value)
addValue (Concept $value)
SeriesgetAttributes
StringgetLabel
StringgetName
ConceptgetValue
StringgetValueType
LogicalisMulti
setAttributes (Series $attributes)
setLabel (String $label)
setValue (Concept $value)
StringtoXML
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getConceptsAtPath, getErrorHandler, getInheritedConcepts, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML

Detailed Constructor Info

create (String $label, Concept $value)
Parameters:
$label :The label of this Element.
$value :The value of this Element.

Constructs a new Element concept with the specified value and label.

top

Detailed Method Info

addAttribute (Attribute $attr)
Parameters:
$attr :Attribute to add.

Adds a new attribute to this Element.

top
addAttribute (String $name, String $label, Concept $value)
Parameters:
$name :The name of the attribute to add.
$label :The label of the attribute to add.
$value :The value of the attribute to add.

Adds a new attribute to this element with the specified name, label and value.

top
addValue (Concept $value)
Parameters:
$value :The value to be added.

Adds a new value to this Element.

top
getAttributes
Returns: Series

Returns a series concept containing all attributes of this Element.

top
getLabel
Returns: String

Returns a string concept representing this Element's label.

top
getName
Returns: String

Returns a string concept representing this Element's name.

top
getValue
Returns: Concept

Returns a concept representing this Element's value.

top
getValueType
Returns: String

Returns this concept's value type.

top
isMulti
Returns: Logical

Returns true always when the element has as value more items/elements (usualy a TypedSeries)

top
setAttributes (Series $attributes)
Parameters:
$attributes :Attributes to be set.

Sets the attributes from the specified series to this Element concept.

top
setLabel (String $label)
Parameters:
$label :The new label to be set.

Sets the label of this Element concept to the specified text.

top
setValue (Concept $value)
Parameters:
$value :The value to be set.

Sets the value of this Element concept to the specified value.

top
toXML
Returns: String

Returns a stream representing the XML rendering of this concept.

top