ObjectDirectory (クラス)
public ObjectDirectory {inherits Directory}
パッケージ: CURL.IO.FILE

パス名を any 型の Curl オブジェクトにマップします。


コンストラクタ
clone-from:ObjectDirectory を初期化します。
コンストラクタ public {ObjectDirectory.clone-from from:ObjectDirectory}
default:ObjectDirectory を初期化します。
コンストラクタ public {ObjectDirectory.default key:String}

プロパティ
name:self の名前。
アクセサ public ObjectDirectory.name:String
parent-dir:self を含む Directory が存在する場合はそれを格納し、存在しない場合は NULL を返します。
アクセサ public ObjectDirectory.parent-dir:#ObjectDirectory
セッター hidden ObjectDirectory.parent-dir:#ObjectDirectory
url:グローバル リソースの名前空間にあるこの Directory のパス名を Url として返します。
アクセサ public ObjectDirectory.url:Url
プロパティ 継承 Directory: size, url-separator
プロパティ 継承 Association-of: efficient-size, empty?, key-type
プロパティ 継承 Aggregate-of: element-type

メソッド
clone:コレクションのクローンを返します。
public {ObjectDirectory.clone}:ObjectDirectory
concat:self.urltail に連結して、新しい Url を作成します。

戻り値のクエリおよびアンカーは tail から解析されます。
public {ObjectDirectory.concat tail:String}:Url
key-exists?:Association-of.key-exists? を参照してください。
public {ObjectDirectory.key-exists? key:String}:bool
keys-to-Iterator:コレクションの各キーを含む Iterator-of を返します。
public {ObjectDirectory.keys-to-Iterator}:{Iterator-of String}
set:Association-of.set を参照してください。
public final {ObjectDirectory.set key:String, element:any}:void
to-Iterator:コレクションの各要素を含む Iterator-of を返します。
public {ObjectDirectory.to-Iterator}:{Iterator-of any}
メソッド 継承 Directory: get, get-if-exists, remove, special-entry?, url-valid-separator?
メソッド 継承 Association-of: clear, filter, filter-clone, filter-keys, filter-keys-clone, get-key, get-key-if-exists
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize



コンストラクタ詳細
clone-from (コンストラクタ)
public {ObjectDirectory.clone-from from:ObjectDirectory}

ObjectDirectory を初期化します。

from: self の初期の内容は from からコピーされます。


default (コンストラクタ)
public {ObjectDirectory.default key:String}

ObjectDirectory を初期化します。

key: 簡単なパス名であることが必要です。これは self の最終的な親から self にアクセスするのに使用されるキーとなります。
root?: TRUE の場合、このパラメータがルートディレクトリになります。親ディレクトリは self に設定されます。

注意事項

警告:selfDirectory 階層に追加されると、{self.parent-dir.resolve self.name} は常に self を返すことになります。



プロパティ詳細
name (アクセサ)
アクセサ public ObjectDirectory.name:String

self の名前。

説明

self が Curl のディレクトリ階層にリンクされている場合、このメソッドはグローバル リソースの名前空間にある self の名前を返します。この場合、
{{url self.name}.resolve}
および
{{abs-url self.name}.resolve}
で生成される値は self に等しく (==) なります。

self がディレクトリ階層にリンクされていない場合、このアクセッサは self が後で Directory のいずれかにインストールされる予定があれば self のキーとして使用される単純な名前を返します。


parent-dir (アクセサ)
アクセサ public ObjectDirectory.parent-dir:#ObjectDirectory
セッター hidden ObjectDirectory.parent-dir:#ObjectDirectory

self を含む Directory が存在する場合はそれを格納し、存在しない場合は NULL を返します。

説明

これが一旦、非 null 値に設定されると、その後は NULL のみしか設定を戻すことができません。他の値への設定ではバグが生じることがあります。したがって、ObjectDirectory を移動する場合は最初にその親を NULL に設定する必要があります。


url (アクセサ)
アクセサ public ObjectDirectory.url:Url

グローバル リソースの名前空間にあるこの Directory のパス名を Url として返します。






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

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

戻り値

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


concat (メソッド)
public {ObjectDirectory.concat tail:String}:Url

self.urltail に連結して、新しい Url を作成します。

戻り値のクエリおよびアンカーは tail から解析されます。



key-exists? (メソッド)
public {ObjectDirectory.key-exists? key:String}:bool

Association-of.key-exists? を参照してください。

説明

key にセパレータ文字を含めないでください (Directory.url-separator を参照してください)。

self key を検索して self key というエントリが含まれている場合は true を返します。


keys-to-Iterator (メソッド)
public {ObjectDirectory.keys-to-Iterator}:{Iterator-of String}

コレクションの各キーを含む 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 のサブクラス内で実装されます。


set (メソッド)
public final {ObjectDirectory.set key:String, element:any}:void

Association-of.set を参照してください。

説明

key にセパレータの文字を含めないでください (Directory.url-separator を参照してください)。

注意事項

key という名前のオブジェトがすでに存在する場合は ExistingFileException をスローします。


to-Iterator (メソッド)
public {ObjectDirectory.to-Iterator}:{Iterator-of any}

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

戻り値

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

説明

Iterator-of の要素の順序は、コレクション型に依存します。配列などの順序付けられたコレクションの場合、このメソッドはその順序を保存します。ハッシュ テーブルやセットなどの順序づけられていないコレクションの場合、要素の順序は任意に指定できます。


{value
    || Create a new set.
    let my-set:{Set-of String} =
        {new {Set-of String}, "apple", "banana", "cherry"}

    || Create an Iterator-of from the set.
    let my-iterator:{Iterator-of String} = {my-set.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:String in my-iterator do
        {message.add each-element}
    }
    message
}

注意事項

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

注意事項

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