Repository (クラス)
public abstract sealed Repository {inherits {Association-of String, any}}
パッケージ: CURL.ENGINE.APPLET

クライアント側のパーシスタント データでエクスポートされるインターフェイスです。

説明

アプレットが他のアプレットとパーシスタント データを共有する場合、アクセスするパーシスタント データを識別するために、get-persistent-data-repository が呼び出されます。get-persistent-data-repositoryRepository 型のオブジェクトを返します。Repository のデータ構造はキーと値のペアになります。キーは String で、値は特定の "persistable" 型に限定されます。詳細については、『開発者ガイド』の「クライアント側のパーシスタント データ」のセクションを参照してください。

プロパティ
プロパティ 継承 Association-of: efficient-size, empty?, key-type, size
プロパティ 継承 Aggregate-of: element-type

メソッド
clone:コレクションのクローンを返します。
public final {Repository.clone}:Repository
commit:Repository 内のキーと値のペアをシリアル化し、それをパーシスタント ストレージに書き込みます。
public {Repository.commit}:void
メソッド 継承 Association-of: clear, filter, filter-clone, filter-keys, filter-keys-clone, get, get-if-exists, get-key, get-key-if-exists, key-exists?, keys-to-Iterator, remove, set
メソッド 継承 Aggregate-of: to-Iterator
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize




プロパティ詳細


メソッド詳細
clone (メソッド)
public final {Repository.clone}:Repository

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

戻り値

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 開発者ガイド』の「コレクション」で、使用しているコレクションのクローンに関するセクションを参照してください。


commit (メソッド)
public {Repository.commit}:void

Repository 内のキーと値のペアをシリアル化し、それをパーシスタント ストレージに書き込みます。

説明

commit は、パーシスタント データに行った変更をパーシスタント ストレージに保存します。アプレットが終了する前に commit が呼ばれないと、最後の commit 以降に行われた変更がすべて失われます。commit メソッドおよび commit-persistent-data プロシージャは、同じ働きをし、同じように使用できます。