Index

Package: Associations

Description

package Values.Associations is
Copyright (c) 2012-2013 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Classes

Assoc_Value

type Assoc_Value is new Value with private;

Ancestors:

Primitive operations:

Compare (overriding Values.Compare)
Delete (overriding Values.Delete)
Get_Type (overriding Values.Get_Type)
Value_Input (overriding Values.Value_Input)
Value_Read (overriding Values.Value_Read)
Value_Write (overriding Values.Value_Write)
Values.=."=" (Inherited)

Assoc_Ptr

type Assoc_Ptr is new Value_Ptr with private;

Ancestors:

Primitive operations:

Create_Assoc
Values.<."<" (Inherited)
Values.<=."<=" (Inherited)
Values.=."=" (Inherited)
Values.>.">" (Inherited)
Values.>=.">=" (Inherited)
Values.Adjust (Inherited)
Values.Clone (Inherited)
Values.Finalize (Inherited)
Values.Get (Inherited)
Values.Set (Inherited)
Values.To_Ptr (Inherited)
Values.Value_Ptr (Inherited)
Values.Value_Ptr_Input (Inherited)
Values.Value_Ptr_Output (Inherited)
Values.Value_Ptr_Read (Inherited)
Values.Value_Ptr_Write (Inherited)

Constants & Global variables

Subprograms & Entries

Create_Assoc

function Create_Assoc return Assoc_Ptr;
Constructor

Clone

function Clone
( this: access Assoc_Value ) return Value_Ptr'Class;

Compare

function Compare
( this: Assoc_Value;
other: Value'Class ) return Integer;

Get_Type

function Get_Type
( this: Assoc_Value ) return Value_Type;

Image

function Image
( this: Assoc_Value ) return String;

Get

function Get
( this: Assoc_Value;
field: String ) return Value_Ptr;
Returns the corresponding value for the key named 'field', or a Null value if the key is not defined.

Is_Empty

function Is_Empty
( this: Assoc_Value ) return Boolean;
Returns True if there are no keys defined in the association.

Iterate

procedure Iterate
( this: Assoc_Value;
examine: not null access procedure( key : String;
value: Value_Ptr ) );
Iterates across each key/value pair in the association, calling 'examine' once for each pair. The order of the iteration is not defined.

Get_Keys

function Get_Keys
( this: Assoc_Value ) return List_Ptr;
Returns a list of the keys in the association as a list of string values. The order of the keys is not defined.

Size

function Size
( this: Assoc_Value ) return Natural;
Returns the number of keys in the association.

Set

procedure Set
( this: in out Assoc_Value;
field: String;
val: Value_Ptr'Class );
Sets or updates the key named 'field' in the association. If 'val' is a null pointer or a Null value then the key will be removed from the association.

As_Assoc

function As_Assoc
( ptr: Value_Ptr'Class ) return Assoc_Ptr;
Casts a Value_Ptr down to an Assoc_Value. Returns Nul on failure.

As_Value

function As_Value
( this: Assoc_Ptr ) return Value_Ptr;
Casts an Assoc_Value up to a Value_Ptr.

Get

function Get
( this: Assoc_Ptr ) return access Assoc_Value'Class;
Returns an access to the Assoc_Value, or null if no target.