GXml.BaseCollection – GXml-0.20 – Vala Binding Reference

GXml.BaseCollection – GXml-0.20 Reference Manual

# BaseCollection

## Object Hierarchy:

## Description:

public abstract class BaseCollection : Object, Traversable<DomElement>, Iterable<DomElement>, Collection

Base class for collections implementing Collection, providing basic infrastructure.

Collections properties should be initialized with current container element in order to be able to add new references to elements. Use initialize_element to set parent element and search to find elements for collection.

All known sub-classes:

- ArrayList
- HashMap
- HashPairedMap
- HashThreeMap

- XsdList
- XsdListComplexTypes
- XsdListElements

- XsdListSimpleTypes
- XsdListTypeRestrictionEnumerations
- XsdListTypeRestrictionWhiteSpaces

Namespace: GXml
Package: GXml-0.20

## Content:

### Properties:

- public DomElement element { get; set construct; }
  A GXml.DomElement with all child elements in collection.
- public string items_name { get; }
  Local name of DomElement objects of element, which could be contained in this collection.
- public Type items_type { get; set construct; }
  A GLib.Type of DomElement child objects of element, which could be contained in this collection.
- public Queue<int> nodes_index { get; }
  A list of child DomElement objects of element

### Creation methods:

- protected BaseCollection ()

### Methods:

- public bool @foreach (ForallFunc<DomElement> f)
- public void append (DomElement node) throws Error
  Adds an DomElement of type GXml.Object as a child of element.
- public virtual void clear () throws Error
  Clear this collection in preparation for a search
- public void initialize (Type items_type) throws Error
  Initialize collection to use a given GXml.Collection derived type. Internally, this method create an instance of given type to initialize items_type and items_name.
- public void initialize_element (Element e) throws Error
  Initialize an Collection to use an element as children's parent. Searches for all nodes, calling Collection.search with Collection.items_type, using its DomElement.local_name to find it.
- public Iterator<DomElement> iterator ()
- public void search () throws Error
  Search for all child nodes in element of type GXml.Element with a GXml.Element.local_name equal to Collection.items_name, to add it to collection. This method calls clear first.
- public abstract bool validate_append (int index, DomElement element) throws Error
  Validate if given node and index, should be added to collection.

### Fields:

- protected Element _element
  Element used to refer of containier element. You should define it at construction time our set it as a construction property.
- protected string _items_name
  Local name of DomElement objects of element, which could be contained in this collection.
- protected Type _items_type
  Objects' type to be referenced by this collection and to deserialize objects. Derived classes, can initialize this value at constructor or as construct property.
- protected Queue<int> _nodes_index
  A collection of node's index referred. Don't modify it manually.

### Inherited Members:

All known members inherited from class GLib.Object

- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data

- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer

- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref

All known members inherited from interface Gee.Traversable

- @foreach
- all_match
- any_match
- chop
- element_type
- filter

- first_match
- flat_map
- fold
- map
- max

- min
- order_by
- scan
- stream
- tee

All known members inherited from interface Gee.Iterable

- iterator

All known members inherited from interface GXml.Collection

- append
- clear
- create_item
- element

- get_item
- initialize
- items_name
- items_type

- length
- nodes_index
- search
- validate_append