クラス TypedJSONArray<T extends JSONValue<?>>

java.lang.Object
io.github.takenoko4096.json.JSONValue<List<T>>
io.github.takenoko4096.json.values.TypedJSONArray<T>
型パラメータ:
T - 要素の型。
すべての実装されたインタフェース:
JSONIterable<T>, JSONStructure, Iterable<T>

@NullMarked public class TypedJSONArray<T extends JSONValue<?>> extends JSONValue<List<T>> implements JSONIterable<T>
型付きのJSONArray。このクラスにラップされる要素はすべてT型であることが確約されます。
  • フィールドの概要

    クラスから継承されたフィールド JSONValue

    value
  • コンストラクタの概要

    コンストラクタ
    コンストラクタ
    説明
     
     
  • メソッドの概要

    修飾子とタイプ
    メソッド
    説明
    void
    add(int index, T value)
    引数に渡されたインデックスに値を格納し、そのインデックス以降の値を後ろに追いやります。
    void
    add(T value)
    配列の後ろに引数に渡された値を追加します。
    boolean
    構造体を空にします。
    構造体のディープコピーを作成します。
    boolean
    delete(int index)
    構造体の指定の添え字番目のオブジェクトを消去します。
    get(int index)
    引数に渡されたインデックスに格納された値を返します。
    値の型を取得します。
    boolean
    has(int index)
    構造体の指定の添え字番目が存在するかどうかを返します。
    boolean
    構造体が空であるかを返します。
     
    int
    構造体の長さを取得します。
    void
    set(int index, T value)
    引数に渡されたインデックスの値を上書きします。
     
    型付き配列を型の保証のないJSONArrayに変換します。

    クラスから継承されたメソッド JSONValue

    equals, hashCode, valueOf

    クラスから継承されたメソッド Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    インタフェースから継承されたメソッド Iterable

    forEach, spliterator
  • コンストラクタの詳細

  • メソッドの詳細

    • getType

      public JSONValueType<?> getType()
      クラスからコピーされた説明: JSONValue
      値の型を取得します。
      定義:
      getType クラス内 JSONValue<List<T extends JSONValue<?>>>
      戻り値:
      この値の型を表現するオブジェクト。
    • has

      public boolean has(int index)
      インタフェースからコピーされた説明: JSONIterable
      構造体の指定の添え字番目が存在するかどうかを返します。
      定義:
      has インタフェース内 JSONIterable<T extends JSONValue<?>>
      パラメータ:
      index - 添え字。
      戻り値:
      存在する場合、真。
    • isEmpty

      public boolean isEmpty()
      インタフェースからコピーされた説明: JSONStructure
      構造体が空であるかを返します。
      定義:
      isEmpty インタフェース内 JSONIterable<T extends JSONValue<?>>
      定義:
      isEmpty インタフェース内 JSONStructure
      戻り値:
      空の場合、真。
    • get

      public T get(int index) throws IllegalArgumentException
      引数に渡されたインデックスに格納された値を返します。
      パラメータ:
      index - インデックス。
      戻り値:
      インデックスに格納された値。
      例外:
      IllegalArgumentException - インデックスが存在しない場合。
    • add

      public void add(int index, T value) throws IllegalArgumentException
      引数に渡されたインデックスに値を格納し、そのインデックス以降の値を後ろに追いやります。
      パラメータ:
      index - インデックス。
      value - 格納する値。
      例外:
      IllegalArgumentException - インデックスが不正な場合。
    • add

      public void add(T value)
      配列の後ろに引数に渡された値を追加します。
      パラメータ:
      value - 格納する値。
    • set

      public void set(int index, T value) throws IllegalArgumentException
      引数に渡されたインデックスの値を上書きします。
      パラメータ:
      index - インデックス。
      value - 格納する値。
      例外:
      IllegalArgumentException - インデックスが不正な場合。
    • delete

      public boolean delete(int index)
      インタフェースからコピーされた説明: JSONIterable
      構造体の指定の添え字番目のオブジェクトを消去します。
      定義:
      delete インタフェース内 JSONIterable<T extends JSONValue<?>>
      パラメータ:
      index - 添え字。
      戻り値:
      削除に成功した場合、真。
    • clear

      public boolean clear()
      インタフェースからコピーされた説明: JSONStructure
      構造体を空にします。
      定義:
      clear インタフェース内 JSONIterable<T extends JSONValue<?>>
      定義:
      clear インタフェース内 JSONStructure
      戻り値:
      空にすることができた場合、真。
    • length

      public int length()
      インタフェースからコピーされた説明: JSONIterable
      構造体の長さを取得します。
      定義:
      length インタフェース内 JSONIterable<T extends JSONValue<?>>
      戻り値:
      長さ。
    • copy

      public TypedJSONArray<T> copy()
      インタフェースからコピーされた説明: JSONStructure
      構造体のディープコピーを作成します。
      定義:
      copy インタフェース内 JSONIterable<T extends JSONValue<?>>
      定義:
      copy インタフェース内 JSONStructure
      戻り値:
      ディープコピーされたオブジェクト。
    • iterator

      public Iterator<T> iterator()
      定義:
      iterator インタフェース内 Iterable<T extends JSONValue<?>>
    • untyped

      public JSONArray untyped()
      型付き配列を型の保証のないJSONArrayに変換します。
      戻り値:
      JSONArray。
    • toString

      public String toString()
      オーバーライド:
      toString クラス内 JSONValue<List<T extends JSONValue<?>>>