SVGStringList

SVGStringList インターフェイス

SVGStringList は string オブジェクトのリストを定義します。

SVGStringList オブジェクトは読み取り専用に設計できます。まりオブジェクトを編集しようとすると例外が投げられることになります。

インターフェイスの概要

Also implement なし
メソッド
  • void clear()
  • string initialize(in string newItem)
  • string getItem(in unsigned long index)
  • string insertItemBefore(in string newItem, in unsigned long index)
  • string replaceItem(in string newItem, in unsigned long index)
  • string removeItem(in unsigned long index)
  • string appendItem(in string newItem)
属性
  • readonly unsigned long numberOfItems
  • readonly unsigned long length Non-standard
Normative document SVG 1.1 (2nd Edition)

属性

名前 説明
numberOfItems unsigned long リスト内の項目の数
length unsigned long numberOfItems のミラー値で、他のインターフェイスの整合性用。 Non-standard

メソッド

名前と引数 戻り値 説明
clear() void

リストから現在の既存アイテムをクリアーし、その結果空のリストになります。

Exceptions:

  • a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself is read only.
initialize(in string newItem) string

リストから現在の既存アイテムをクリアーしてパラメーターで指定された単一項目を保持するように初期化します。挿入した項目が既にある場合は、直前のリストから削除された後に挿入されます。挿入した項目は項目自体であってコピーではありません。戻り値はリストに挿入された項目です。

Exceptions:

  • a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself is read only.
getItem(in unsigned long index) string

リスト内の指定した項目を返します。戻り値は項目自体であってコピーではありません。戻り値はリストに挿入された項目です。項目になされた変更は即座にリストに反映されます。最初の項目は数字のゼロです。

Exceptions:

  • a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself is read only.
insertItemBefore(in string newItem, in unsigned long index) string

リストの指定した位置に新しい項目を挿入します。最初の項目は数字の 0 です。newItem がリスト中にすでに存在する場合、リストに挿入される前に以前のリストから削除されます。挿入される項目は項目自身でコピーではありません。注意点としてその前に挿入するという index は項目を削除する前の時点です。index が 0 と等しい場合、新項目はリストの前に挿入されます。index が numberOfItems 以上の場合、新項目はリストの後に挿入されます。

Exceptions:

  • a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself is read only.
replaceItem(in string newItem, in unsigned long index) string

リスト内の項目を新項目に置き換えます。newItem がリスト内にすでに存在する場合、リストに挿入される前に以前のリストから削除されます。挿入される項目は項目自身でコピーではありません。項目がリストにすでに存在する場合、注意点として置換する項目の index は項目を削除する前の時点です。

Exceptions:

  • a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself is read only.
  • a DOMException with code INDEX_SIZE_ERR is raised if the index number is greater than or equal to numberOfItems.
removeItem(in unsigned long index) string

リストから既存項目を削除します。

Exceptions:

  • a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself is read only.
  • a DOMException with code INDEX_SIZE_ERR is raised if the index number is greater than or equal to numberOfItems.
appendItem(in string newItem) string

リストの最後に新項目を挿入します。newItem がリスト内にすでに存在する場合、リストに挿入される前に以前のリストから削除されます。挿入される項目は項目自身でコピーではありません。

Exceptions:

  • a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself is read only.

ブラウザー実装状況

BCD tables only load in the browser