{Association-of tk:Type, te:Type} (クラス)
public abstract Association-of {inherits {Aggregate-of te}}
パッケージ: CURL.LANGUAGE.CONTAINERS
直接継承しているサブクラス: Repository, CPAMetrics, Dictionary-of, Directory, RecordData, BucketHashTable-of, Sequence-of, HashTable-of

要素にキーを関連付けるコレクションの抽象パラメータ化クラス。

tk: コレクション内のキーのデータ型。
te: コレクション内の要素のデータ型。

説明

Curl言語には、以下のようなコレクション タイプが組み込まれています。



Association-of は、要素にキーを関連付けるコレクション クラスのインターフェイスを提供します。ハッシュ テーブル (HashTable-of) は、Curl に組み込まれているこうした唯一のコレクションです。

Association-of は抽象クラスなので、インスタンス化できません。キーまたは要素コレクション オブジェクトを作成するには、HashTable-of をインスタンス化します。

注意事項

Curl のコレクションクラスの部分階層は次のようになります。
Curl のコレクションの詳細は、Curl 開発者ガイド: コレクション を参照してください。

プロパティ
efficient-size:selfefficient-size を取得または設定します。
アクセサ public inline Association-of.efficient-size:int
セッター public inline Association-of.efficient-size:int
empty?:コレクションが空かどうかを調べます。
アクセサ public Association-of.empty?:bool
key-type:キーのデータ型を返します。
アクセサ public final inline Association-of.key-type:Type
size:コレクションの要素数を返します。
アクセサ public abstract Association-of.size:int
プロパティ 継承 Aggregate-of: element-type

メソッド
clear:すべての要素を削除します。
public {Association-of.clear}:void
clone:コレクションのクローンを返します。
public abstract {Association-of.clone}:{Association-of tk, te}
filter:フィルタ操作内で要素を使って要素自体をフィルタリングします。
public {Association-of.filter p:{proc-type {te}:bool}}:void
filter-clone:(フィルタ操作内で要素を使って) クローンの要素が選別された、コレクションのクローンを返します。
public {Association-of.filter-clone
p:{proc-type {te}:bool}
}:{Association-of tk, te}
filter-keys:フィルタ操作でキーを使って要素をフィルタリングします。
public {Association-of.filter-keys p:{proc-type {tk}:bool}}:void
filter-keys-clone:(フィルタ操作内でキーを使って) 要素が選別された、コレクションのクローンを返します。
public {Association-of.filter-keys-clone
p:{proc-type {tk}:bool}
}:{Association-of tk, te}
get:特定の要素を返します。
public {Association-of.get key:tk}:te
get-if-exists:key でインデックス付けされた要素と、示された要素が見つかったかどうかを示すブール値を返します。
public abstract {Association-of.get-if-exists
key:tk
}:(value:te, found?:bool)
get-key:特定のキーを返します。
public {Association-of.get-key key:tk}:tk
get-key-if-exists:特定のキーと、示された要素が見つかったかどうかを示すブール値を返します。
public {Association-of.get-key-if-exists key:tk}:(key:tk, found?:bool)
key-exists?:キーが存在するかどうかを調べます。
public {Association-of.key-exists? key:tk}:bool
keys-to-Iterator:コレクションの各キーを含む Iterator-of を返します。
public abstract {Association-of.keys-to-Iterator}:{Iterator-of tk}
remove:要素を削除します。
public abstract {Association-of.remove
key:tk,
length:int = 1,
error-if-missing?:bool = true
}:void
set:要素の値を設定します。
public abstract {Association-of.set key:tk, element:te}:void
メソッド 継承 Aggregate-of: to-Iterator
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize




プロパティ詳細
efficient-size (アクセサ)
アクセサ public inline Association-of.efficient-size:int
セッター public inline Association-of.efficient-size:int

selfefficient-size を取得または設定します。

説明

コレクションに設定される efficient-size は、コレクションを拡張可能なサイズで、なお 効率的に機能するサイズです。このアクセッサは実装ごとに定義されますが、一般に下位のデータ構造のサイズを反映します。割り当てサイズを超えて拡張する場合、下位のデータ構造を新しく割り当て、古いデータ構造からデータをコピーする必要があります。ただし、この処理は 効率的でない と見なされます。
requested-size: requested-size は、コレクション型およびコレクションの中に格納されたタイプが与えられると、システムによって評価され、また変更される場合もあります。ゲッターから獲得した際、結果の efficient-size は、requested-size 以上の値になります。

注意事項

Association-of で定義された既定の実装では、セッターは無視され、ゲッターは max-int を返します。


empty? (アクセサ)
アクセサ public Association-of.empty?:bool

コレクションが空かどうかを調べます。

戻り値

bool 値。self に要素がない場合、true を返します。それ以外の場合は、false を返します。

次の例は、要素をもたないハッシュ テーブルを示しています。


|| Declare and initialize an empty hash table.
{let my-table:{HashTable-of int, String} =
    {new {HashTable-of int, String}}}

|| Check if the hash table is empty and display an
|| appropriate message.
{if my-table.empty? then
    {text The hash table is empty!}
 else
    {text The hash table has elements!}
}


次の例は、要素を持つハッシュ テーブルを示しています。


|| Declare and initialize a hash table with
|| int keys and String elements.
{let my-table:{HashTable-of int, String} =
    {new {HashTable-of int, String},
        1, "apple"
    }
}

|| Check if the hash table is empty and display an
|| appropriate message.
{if my-table.empty? then
    {text The hash table is empty!}
 else
    {text The hash table has elements!}
}


key-type (アクセサ)
アクセサ public final inline Association-of.key-type:Type

キーのデータ型を返します。

戻り値

有効なデータ型。


{value
    || Declare and initialize a hash table with
    || String keys and int elements
    let price:{HashTable-of String, int} =
        {new {HashTable-of String, int},
             "apple", 56,
             "banana", 87,
             "cherry", 34
        }

    || Display the data type of key in price.
    price.key-type
}


size (アクセサ)
アクセサ public abstract Association-of.size:int

コレクションの要素数を返します。

戻り値

self の要素数を示すint


{value
    || Declare and initialize a hash table with
    || String keys and int elements.
    let price:{HashTable-of String, int} =
        {new {HashTable-of String, int},
             "apple", 56,
             "banana", 87,
             "cherry", 34
        }

    || Display a message indicating the size of
    || the hash table.
    {text There are {value price.size} elements in
        the hash table.}
}

注意事項

これは Association-of の抽象メソッドで、Association-of のサブクラス内で実装されます。





メソッド詳細
clear (メソッド)
public {Association-of.clear}:void

すべての要素を削除します。

説明

このメソッドは、コレクションを反復処理することで、一度に 1 つの要素を削除します。Association-ofをサブクラス化すると、このメソッドをオーバーライドし、効率的な実装が可能になります。たとえば、コレクションに書き込み可能な size プロパティがある場合、要素を反復処理するよりも size をリセットする方が効率的です。


{value
    || Declare and initialize a hash table with
    || int keys and String elements.
    let my-table:{HashTable-of int, String} =
        {new {HashTable-of int, String},
             162094, "tom",
             439853, "dick",
             098627, "harry"
        }

    || Clear the hash table.
    {my-table.clear}

    || Check if the hash table is empty.
    {text The assertion that the hash table is empty is...
        {value my-table.empty?}}
}


clone (メソッド)
public abstract {Association-of.clone}:{Association-of tk, te}

コレクションのクローンを返します。

戻り値

Aggregate-of のサブクラスのインスタンス。オブジェクトは、self と同じデータ型およびデータを持ちます。

説明

クローンは、self と同じデータ型を持つ新しいオブジェクトです。クローンには、self の要素の簡易コピー(shallow copy) が含まれます。つまり、どちらかのコレクションの要素に新しいオブジェクトを代入すると、もう一方の一致した要素は元のオブジェクトを参照します。ただし、要素のオブジェクトを変更すると、両方のコレクションは変更したオブジェクトを参照します。


{value
    || Declare and initialize set-1 (the original set).
    let set-1:{Set-of String} =
        {new {Set-of String}, "apple", "banana", "cherry"}

    || Initialize set-2 with a clone of the contents of
    || set-1.
    let set-2:{Set-of String} = {set-1.clone}

    || Use a VBox to display the contents of set-2.
    || Iterate over the contents of set-2, adding them
    || to the VBox.  Then display the VBox.
    let message:VBox = {VBox}
    {for each-element:String in set-2 do
        {message.add each-element}
    }
    message
}

注意事項

これは Aggregate-of の抽象メソッドで、Aggregate-of のサブクラス内で実装されます。

注意事項

クローンの詳細については、『Curl 開発者ガイド』の「コレクション」で、使用しているコレクションのクローンに関するセクションを参照してください。


filter (メソッド)
public {Association-of.filter p:{proc-type {te}:bool}}:void

フィルタ操作内で要素を使って要素自体をフィルタリングします。

p: 要素をフィルタリングするプロシージャ。このメソッドは、self の各要素に対して p を呼び出します。プロシージャには、self の要素と同じデータ型を持つ 1 つの引数を指定する必要があります。プロシージャは、このメソッドが要素をフィルタリングするかどうかを示す bool 値を返す必要があります。pfalse を返す場合、このメソッドは self からその要素をフィルタリング (削除) します。ptrue を返す場合、要素は、self 内に残ります。

戻り値

このメソッドは値を返しません。

説明

p への呼び出しが false を返すコレクションの要素を削除します。

次の例では、ハッシュ テーブルから要素をフィルタリングします。


{value
    || Declare and initialize a hash table with
    || int keys and String elements.
    let my-table:{HashTable-of int, String} =
        {new {HashTable-of int, String},
             162094, "tom",
             439853, "dick",
             098627, "harry"
        }

    || Filter elements that begin with the
    || letter 'd'.
    {my-table.filter
        {proc {str:String}:bool
            {return str[0] != 'd'}
        }
    }

    || Use a VBox to display the contents of my-table.
    || Add each element to the VBox and then display it.
    let message:VBox = {VBox}
    {for each-element:String in my-table do
        {message.add each-element}
    }
    message

    || Note that the order of the elements in a hash
    || table is arbitrary.
}


filter-clone (メソッド)
public {Association-of.filter-clone
p:{proc-type {te}:bool}
}:{Association-of tk, te}

(フィルタ操作内で要素を使って) クローンの要素が選別された、コレクションのクローンを返します。

p: 要素をフィルタリングするプロシージャ。このメソッドは、self の各要素に対して p を呼び出します。プロシージャには、self の要素と同じデータ型を持つ 1 つの引数を指定する必要があります。プロシージャは、このメソッドが要素をフィルタリングするかどうかを示す bool 値を返す必要があります。pfalse を返す場合、このメソッドは self からその要素をフィルタリング (削除) します。ptrue を返す場合、要素は、self 内に残ります。

戻り値

Association-of のサブクラスのインスタンス。オブジェクトは、self と同じデータ型を持ちます。オブジェクトには、いくつかの要素がフィルタリングされた、コレクションのクローンが含まれます。

説明

このメソッドは、self のクローンを返します。クローンでは、p プロシージャへの呼び出しが false を返す要素が削除されます。クローンとは、self と同じデータ型を持つ新しいオブジェクトです。クローンには、self の浅い要素のコピー(shallow copy) が含まれます。つまり、どちらかの集合の要素に新しいオブジェクトを代入すると、もう一方の一致した要素は元のオブジェクトを参照します。ただし、要素のオブジェクトを変更すると、両方の集合は変更したオブジェクトを参照します。

次の例は、先頭に文字 d が付くすべての要素が除外されたハッシュ テーブルのクローンを作成します。


{value
    || Declare and initialize a hash table with
    || int keys and String elements.
    let my-table-1:{HashTable-of int, String} =
        {new {HashTable-of int, String},
             162094, "tom",
             439853, "dick",
             098627, "harry"
        }

    || Create a clone my-table-2 that contains the elements
    || of my-table-1 with strings that begin with the letter
    || 'd' filtered out.
    let my-table-2:{HashTable-of int, String} =
        {my-table-1.filter-clone
            {proc {str:String}:bool
                {return str[0] != 'd'}
            }
        }

    || Use a VBox to display the contents of my-table-2.
    || Iterate over the contents of my-table-2, adding
    || them to the VBox.  Then display the VBox.
    let message:VBox = {VBox}
    {for each-element:String in my-table-2 do
        {message.add each-element}
    }
    message

    || Note that the order of the elements in a hash
    || table is arbitrary.
}

注意事項

クローンの詳細については、『Curl 開発者ガイド』の「コレクション」で、使用しているコレクションのクローンに関するセクションを参照してください。


filter-keys (メソッド)
public {Association-of.filter-keys p:{proc-type {tk}:bool}}:void

フィルタ操作でキーを使って要素をフィルタリングします。

p: 要素をフィルタリングするプロシージャ。このメソッドは、self の各キーに対して p を呼び出します。プロシージャには、self のキーと同じデータ型を持つ 1 つの引数を指定する必要があります。プロシージャは、関連付けられた要素をこのメソッドがフィルタリングするかどうかを示す bool 値を返す必要があります。pfalse を返す場合、このメソッドは self からその要素をフィルタリング (削除) します。ptrue を返す場合、要素は、self 内に残ります。

説明

関連付けられたキーを持つ p への呼び出しが false を返す self の要素を削除します。


{value
    || Declare and initialize a hash table with
    || String keys and int elements.
    let quantity:{HashTable-of String, int} =
        {new {HashTable-of String, int},
             "apple", 3,
             "banana", 0,
             "cherry", 8
        }

    || Filter elements whose keys begin with 'a'.
    {quantity.filter-keys
        {proc {str:String}:bool
            {return str[0] != 'a'}
        }
    }

    || Use a VBox to display the contents of quantity.
    || For each key in quantity, add the key to the VBox.
    || Then display the VBox.
    let message:VBox = {VBox}
    {for key each-element:String in quantity do
        {message.add each-element}
    }
    message

    || Note that the order of the elements in a hash
    || table is arbitrary.
}


filter-keys-clone (メソッド)
public {Association-of.filter-keys-clone
p:{proc-type {tk}:bool}
}:{Association-of tk, te}

(フィルタ操作内でキーを使って) 要素が選別された、コレクションのクローンを返します。

p: 要素をフィルタリングするプロシージャ。このメソッドは、self の各キーに対して p を呼び出します。プロシージャには、self のキーと同じデータ型を持つ 1 つの引数を指定する必要があります。プロシージャは、関連付けられた要素をこのメソッドがフィルタリングするかどうかを示す bool 値を返す必要があります。pfalse を返す場合、このメソッドは self からその要素をフィルタリング (削除) します。ptrue を返す場合、要素は、self 内に残ります。

戻り値

Association-of のサブクラスのインスタンス。オブジェクトは、self と同じデータ型を持ちます。

説明

このメソッドは、self のクローンを返します。クローンでは、関連付けられたキーを持つ p への呼び出しが false を返す self の要素が削除されます。クローンとは、self と同じデータ型を持つ新しいオブジェクトです。クローンには、self の浅い要素のコピー(shallow copy)が含まれます。つまり、どちらかの集合の要素に新しいオブジェクトを代入すると、もう一方の一致した要素は元のオブジェクトを参照します。ただし、要素のオブジェクトを変更すると、両方の集合は変更したオブジェクトを参照します。


{value
    || Declare and initialize a hash table with
    || String keys and int elements.
    let quantity:{HashTable-of String, int} =
        {new {HashTable-of String, int},
             "apple", 3,
             "banana", 0,
             "cherry", 8
        }

    || Create a clone that contains the elements of the
    || original with keys that begin with the letter
    || 'a' filtered out.
    let new-quantity:{HashTable-of String, int} =
        {quantity.filter-keys-clone
            {proc {str:String}:bool
                {return str[0] != 'a'}
            }
        }

    || Use a VBox to display the contents of quantity.
    || For each key in quantity, add the key to the VBox.
    || Then display the VBox.
    let message:VBox = {VBox}
    {for key each-element:String in new-quantity do
        {message.add each-element}
    }
    message

    || Note that the order of the elements in a hash
    || table is arbitrary.
}

注意事項

クローンの詳細については、『Curl 開発者ガイド』の「コレクション」で、使用しているコレクションのクローンに関するセクションを参照してください。


get (メソッド)
public {Association-of.get key:tk}:te

特定の要素を返します。

key: 取得する要素のキーの値。この値は、self のキーと同じデータ型を持つ必要があります。

戻り値

取得する要素。戻り値は self の要素と同じデータ型を持ちます。

例外のスロー

そのような要素が存在しない場合は、KeyNotFoundException をスローします。

説明

key と関連する、self にある要素を返します。 get-if-exists も参照してください。


{value
    || Declare and initialize a hash table with
    || String keys and int elements.
    let price:{HashTable-of String, int} =
        {new {HashTable-of String, int},
             "apple", 56,
             "banana", 87,
             "cherry", 34
        }

    || Check for the presence of "banana" and "cherry",
    || showing how [] syntax can be used to call "get"
    || methods.
    {text The price of bananas is {price.get "banana"},
        the price of cherries is {value price["cherry"]}.}

    || Note that the order of the elements in a hash
    || table is arbitrary.
}


get-if-exists (メソッド)
public abstract {Association-of.get-if-exists
key:tk
}:(value:te, found?:bool)

key でインデックス付けされた要素と、示された要素が見つかったかどうかを示すブール値を返します。

key: 取得する要素のキーの値。

戻り値

このメソッドは次の 2 つの値を返します。2 番目に返される値が false の場合、最初に返される値は不確定です。


get-key (メソッド)
public {Association-of.get-key key:tk}:tk

特定のキーを返します。

key: 取得するキーの値。

戻り値

キー。戻り値は、self のキーと同じデータ型を持ちます。

説明

パラメータ keyself のキーである場合はこのキーを返します。それ以外の場合は KeyNotFoundException をスローします。このメソッドはインターン化を目的とする場合に役にたちます。
get-key-if-exists も参照してください。


|| Declare and initialize a hash table with
|| String keys and int elements.
{let price:{HashTable-of String, int} =
    {new {HashTable-of String, int},
         "apple", 56,
         "banana", 87,
         "cherry", 34
    }
}

|| Use the get-key method to get the original keys.
The hash table contains prices for...
  {price.get-key "apple"}
  {price.get-key "banana"}
  {price.get-key "cherry"}


get-key-if-exists (メソッド)
public {Association-of.get-key-if-exists key:tk}:(key:tk, found?:bool)

特定のキーと、示された要素が見つかったかどうかを示すブール値を返します。

key: 取得するキーの値。

戻り値

指定されたキーに等しいコンテナが使用しているキー。戻り値は、self のキーと同じデータ型を持ちます。また、キーが見つかったかどうかを示すフラグを返します。

説明

key パラメータが self 内のキーの場合、そのキーを返します。この場合、2 番目に返される値は true になります。それ以外の場合、返される値は定義されず、2 番目に戻される値は false になります。


|| Declare and initialize a hash table with
|| String keys and int elements.
{let price:{HashTable-of String, int} =
    {new {HashTable-of String, int},
         "apple", 56,
         "banana", 87,
         "cherry", 34
    }
}

|| Use the get-key-if-exists method to check for the
|| presence of keys.
The hash table contains prices for...
  {price.get-key-if-exists "apple"}
  {price.get-key-if-exists "banana"}
  {price.get-key-if-exists "pear"}
  {price.get-key-if-exists "cherry"}
  {price.get-key-if-exists "orange"}

注意事項

このメソッドは、Association-ofで実装されます。Association-of のいくつかのサブクラス内でオーバーライドされます。


key-exists? (メソッド)
public {Association-of.key-exists? key:tk}:bool

キーが存在するかどうかを調べます。

key: 調べるキーの値。値は、self のキーと同じデータ型を持つ必要があります。

戻り値

bool 値。値が self のキーである場合、このメソッドは true を返します。それ以外の場合は、false を返します。


{value
    || Declare and initialize a hash table with
    || String keys and int elements.
    let price:{HashTable-of String, int} =
        {new {HashTable-of String, int},
             "apple", 56,
             "banana", 87,
             "cherry", 34
        }

    || Check if there is an element with the
    || key "banana" in the collection "price".
    {if {price.key-exists? "banana"} then
        {text It is there!}
     else
        {text It is not there.}
    }
}


keys-to-Iterator (メソッド)
public abstract {Association-of.keys-to-Iterator}:{Iterator-of tk}

コレクションの各キーを含む Iterator-of を返します。

戻り値

self の要素と同じパラメータ化データ型を持つ Iterator-of。つまり、self{Association-of int, String} の場合、このメソッドは {Iterator-of int} を返します。

説明

Iterator-of のキーの順序は、任意に指定できます (Association-of のインスタンスが、順序付けられたコレクションでない場合もあるからです)。


{value
    || Declare and initialize a hash table with
    || int keys and String elements.
    let my-table:{HashTable-of int, String} =
        {new {HashTable-of int, String},
             162094, "tom",
             439853, "dick",
             098627, "harry"
        }

    || Create an Iterator-of from the set.
    let my-iterator:{Iterator-of int} =
        {my-table.keys-to-Iterator}

    || Use a VBox to display the contents of my-iterator.
    || Iterate over the contents of my-iterator, adding
    || them to the VBox.  Then display the VBox.
    let message:VBox = {VBox}
    {for each-element:int in my-iterator do
        {message.add each-element}
    }
    message

    || Note that the order of the elements in a hash
    || table is arbitrary.
}

注意事項

for コンテナ ループを使って同じ結果を得ることもできます。ただし、この反復処理メカニズムをオーバーライドすると、予期外の結果が生じる可能性があるので、可能な限り for ループを使用してください。

注意事項

これは Association-of の抽象メソッドで、Association-of のサブクラス内で実装されます。


remove (メソッド)
public abstract {Association-of.remove
key:tk,
length:int = 1,
error-if-missing?:bool = true
}:void

要素を削除します。

key: 削除する要素のキーの値。この値は、self のキーと同じデータ型を持つ必要があります。
length: このパラメータを指定するとエラーになります。

length コレクションから削除する連続する要素の数を示す int。ただし、このメソッドでは、ハッシュ テーブルは順序付けられたコレクションではないので、このパラメータには意味がありません。このパラメータは、順序付けられたコレクションを実装する Sequence-of のサブクラスにのみ適用されます。

このメソッドでは、length は既定値の 1 に設定されています。
error-if-missing?: ユーザーが存在しない要素を削除しようとしたときにこのメソッドがエラーを生成するかどうかを示すブール値のフラグ。error-if-missing?true に設定した場合、存在しない要素を削除しようとするとエラーがスローされます。エラーが発生するとプログラムの実行が停止し、エラー メッセージが表示されます。既定では、error-if-missing?true です。error-if-missing?false の場合、このメソッドはエラーを生成しません。error-if-missing? キーワード引数。error-if-missing?を指定するには、メソッド呼び出し内のキーワードに必要な値 (例:error-if-missing?=false) を指定します。

説明

{self.key-exists? key}true を返す場合、このメソッドは self から適切なキーおよび要素を削除します。

{self.key-exists? key}false で、 error-if-missing?true の場合、このメソッドはエラーをスローします。ただし、 error-if-missing?false の場合、このメソッドは何のアクションも実行しません。


{value
    || Declare and initialize a hash table with
    || String keys and int elements.
    let price:{HashTable-of String, int} =
        {new {HashTable-of String, int},
             "apple", 56,
             "banana", 87,
             "cherry", 34
        }

    || Remove the element at key "banana".
    {price.remove "banana"}

    || Use a VBox to display the contents of price.
    || For each key in price, add a string to the VBox.
    || The string contains the relevant key and element.
    || Then display the VBox.
    let message:VBox = {VBox}
    {for key each-element:String in price do
        {message.add each-element & " " & {price.get each-element}}
    }
    message

    || Note that the order of the elements in a hash
    || table is arbitrary.
}

注意事項

これは Association-of の抽象メソッドで、Association-of のサブクラス内で実装されます。


set (メソッド)
public abstract {Association-of.set key:tk, element:te}:void

要素の値を設定します。

key: 設定する要素のキーの値。この値は、self のキーと同じデータ型を持つ必要があります。
element: 要素の値。この値は、selfの要素と同じデータ型を持つ必要があります。

説明

keyself に存在する場合、このメソッドは element に関連付けられた要素の値を変更します。keyself に存在しない場合、このメソッドは新しい要素 (keyelement) を self に追加します。


{value
    || Declare and initialize a hash table with
    || String keys and int elements.
    let price:{HashTable-of String, int} =
        {new {HashTable-of String, int},
             "apple", 56,
             "banana", 87,
             "cherry", 34
        }

    || Change the element at key "banana".
    {price.set "banana", 72}

    || Add an element for "pear".
    {price.set "pear", 62}

    || Use a VBox to display the contents of price.
    || For each key in price, add a string to the VBox.
    || The string contains the relevant key and element.
    || Then display the VBox.
    let message:VBox = {VBox}
    {for key each-element:String in price do
        {message.add each-element & " " & {price.get each-element}}
    }
    message

    || Note that the order of the elements in a hash
    || table is arbitrary.
}

注意事項

これは Association-of の抽象メソッドで、Association-of のサブクラス内で実装されます。