LocalDirectory (クラス)
public sealed LocalDirectory {inherits NormalDirectory}
パッケージ: CURL.IO.FILE

ローカル ファイルシステムに存在する Directory


プロパティ
local-name:ローカル ファイルシステムのこの Directory の名前。
フィールド public constant LocalDirectory.local-name:String
name:self の名前。
アクセサ public LocalDirectory.name:String
parent-dir:self を含む Directory
アクセサ public LocalDirectory.parent-dir:Directory
url:グローバル リソースの名前空間にあるこの Directory のパス名を Url として返します。
アクセサ public LocalDirectory.url:Url
プロパティ 継承 Directory: size, url-separator
プロパティ 継承 Association-of: efficient-size, empty?, key-type
プロパティ 継承 Aggregate-of: element-type

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

戻り値のクエリおよびアンカーは tail から解析されます。
public {LocalDirectory.concat tail:String}:Url
keys-to-Iterator:コレクションの各キーを含む Iterator-of を返します。
public {LocalDirectory.keys-to-Iterator}:{Iterator-of String}
to-Iterator:コレクションの各要素を含む Iterator-of を返します。
public {LocalDirectory.to-Iterator}:{Iterator-of any}
メソッド 継承 Directory: get, get-if-exists, key-exists?, remove, set, 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




プロパティ詳細
local-name (フィールド)
public constant LocalDirectory.local-name:String

ローカル ファイルシステムのこの Directory の名前。

注意事項

LocalDirectorylocal-name は絶対名です。


name (アクセサ)
アクセサ public LocalDirectory.name:String

self の名前。

説明

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

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


parent-dir (アクセサ)
アクセサ public LocalDirectory.parent-dir:Directory

self を含む Directory

説明

selfDirectory 階層にインストールされていない場合は null になります。


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

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






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

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

戻り値

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 {LocalDirectory.concat tail:String}:Url

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

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



keys-to-Iterator (メソッド)
public {LocalDirectory.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 のサブクラス内で実装されます。


to-Iterator (メソッド)
public {LocalDirectory.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 のサブクラス内で実装されます。