类 DataList

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Object>
com.alibaba.fastjson2.JSONArray
top.yqingyu.common.qydata.DataList
所有已实现的接口:
Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, RandomAccess

public class DataList extends com.alibaba.fastjson2.JSONArray implements Cloneable, Serializable
版本:
1.0.1
作者:
YYJ
另请参阅:
  • 字段概要

    从类继承的字段 java.util.AbstractList

    modCount
  • 构造器概要

    构造器
    构造器
    说明
    default
    DataList(int initialCapacity)
     
    DataList(Object... items)
     
    DataList(Collection<?> collection)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    add(int index, Object element)
    Inserts the specified element at the specified position in this list.
    boolean
    Appends the specified element to the end of this list.
    boolean
    addAll(int index, Collection<?> c)
    Inserts all of the elements in the specified collection into this list, starting at the specified position.
    boolean
    Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's Iterator.
    void
    Removes all of the elements from this list.
     
    boolean
    Returns true if this list contains the specified element.
    boolean
    void
    ensureCapacity(int minCapacity)
    Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
    boolean
    fluentAdd(Object element)
    Chained addition of elements
     
     
    fluentRemove(int index)
     
     
     
    fluentSet(int index, Object element)
     
    void
    forEach(java.util.function.Consumer<? super Object> action)
     
    get(int index)
    Returns the element at the specified position in this list.
    getBigDecimal(int index)
    Returns the BigDecimal at the specified location in this DataList.
    getBigInteger(int index)
    Returns the BigInteger at the specified location in this DataList.
    getBoolean(int index)
    Returns the Boolean at the specified location in this DataList.
    boolean
    getBooleanValue(int index)
    Returns a boolean value at the specified location in this DataList.
    getByte(int index)
    Returns the Byte at the specified location in this DataList.
    byte
    getByteValue(int index)
    Returns a byte value at the specified location in this DataList.
    getDataList(int index)
    Returns the DataList at the specified location in this DataList.
    getDataMap(int index)
    Returns the DataMap at the specified location in this DataList.
    getDate(int index)
    Returns the Date at the specified location in this DataList.
    getDouble(int index)
    Returns the Double at the specified location in this DataList.
    double
    getDoubleValue(int index)
    Returns a double value at the specified location in this DataList.
    getFloat(int index)
    Returns the Float at the specified location in this DataList.
    float
    getFloatValue(int index)
    Returns a float value at the specified location in this DataList.
    java.time.Instant
    getInstant(int index)
    Returns the Instant at the specified location in this DataList.
    getInteger(int index)
    Returns the Integer at the specified location in this DataList.
    int
    getIntValue(int index)
    Returns an int value at the specified location in this DataList.
    getLong(int index)
    Returns the Long at the specified location in this DataList.
    long
    getLongValue(int index)
    Returns a long value at the specified location in this DataList.
    <T> T
    getObject(int index, Class<T> type, com.alibaba.fastjson2.JSONReader.Feature... features)
    Returns the result of the Type converter conversion of the element at the specified position in this DataList.
    <T> T
    getObject(int index, Type type, com.alibaba.fastjson2.JSONReader.Feature... features)
    Returns the result of the Type converter conversion of the element at the specified position in this DataList.
    <T> T
    getObject(int index, java.util.function.Function<com.alibaba.fastjson2.JSONObject,T> creator)
     
    getShort(int index)
    Returns the Short at the specified location in this DataList.
    short
    getShortValue(int index)
    Returns a short value at the specified location in this DataList.
    getString(int index)
    Returns the String at the specified location in this DataList.
    int
    int
    Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
    boolean
    Returns true if this list contains no elements.
    boolean
    isValid(com.alibaba.fastjson2.schema.JSONSchema schema)
     
    Returns an iterator over the elements in this list in proper sequence.
    int
    Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
    Returns a list iterator over the elements in this list (in proper sequence).
    listIterator(int index)
    Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
    java.util.stream.Stream<Object>
    Returns a possibly parallel Stream with this collection as its source.
    remove(int index)
    Removes the element at the specified position in this list.
    boolean
    Removes the first occurrence of the specified element from this list, if it is present.
    boolean
    Removes from this list all of its elements that are contained in the specified collection.
    boolean
    removeIf(java.util.function.Predicate<? super Object> filter)
     
    protected void
    removeRange(int fromIndex, int toIndex)
    Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive.
    void
    replaceAll(java.util.function.UnaryOperator<Object> operator)
     
    boolean
    Retains only the elements in this list that are contained in the specified collection.
    set(int index, Object element)
    Replaces the element at the specified position with the specified element
    int
    Returns the number of elements in this list.
    void
    sort(Comparator<? super Object> c)
     
    Creates a late-binding and fail-fast Spliterator over the elements in this list.
    java.util.stream.Stream<Object>
    Returns a sequential Stream with this collection as its source.
    subList(int fromIndex, int toIndex)
    Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
    <T> T
    to(Class<T> type)
     
    <T> T
    to(Type type)
    Convert this DataList to the specified Object
    Returns an array containing all of the elements in this list in proper sequence (from first to last element).
    <T> T[]
    toArray(Class<T> itemClass, com.alibaba.fastjson2.JSONReader.Feature... features)
    Convert all the members of this DataList into the specified Object.
    <T> T[]
    toArray(java.util.function.IntFunction<T[]> generator)
    Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array.
    <T> T[]
    toArray(T[] a)
    Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.
    <T> List<T>
    toJavaList(Class<T> clazz, com.alibaba.fastjson2.JSONReader.Feature... features)
    已过时。
    since 2.0.4, please use toList(Class, JSONReader.Feature...)
    <T> T
    已过时。
    since 2.0.4, please use to(Type)
    byte[]
    toJSONBBytes(com.alibaba.fastjson2.JSONWriter.Feature... features)
    Serialize to JSONB bytes
    toJSONString(com.alibaba.fastjson2.JSONWriter.Feature... features)
    Serialize to JSON String
    <T> List<T>
    toList(Class<T> itemClass, com.alibaba.fastjson2.JSONReader.Feature... features)
    Convert all the members of this DataList into the specified Object.
     
    toString(com.alibaba.fastjson2.JSONWriter.Feature... features)
    Serialize to JSON String
    void
    Trims the capacity of this ArrayList instance to be the list's current size.

    从类继承的方法 com.alibaba.fastjson2.JSONArray

    getJSONArray, getJSONObject, of, of, of, of, parseArray

    从类继承的方法 java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • 构造器详细资料

    • DataList

      public DataList()
      default
    • DataList

      public DataList(int initialCapacity)
      参数:
      initialCapacity - the initial capacity of the DataList
      抛出:
      IllegalArgumentException - If the specified initial capacity is negative
    • DataList

      public DataList(Collection<?> collection)
      参数:
      collection - the collection whose elements are to be placed into this DataList
      抛出:
      NullPointerException - If the specified collection is null
    • DataList

      public DataList(Object... items)
      参数:
      items - the array whose elements are to be placed into this DataList
      抛出:
      NullPointerException - If the specified items is null
  • 方法详细资料

    • set

      public Object set(int index, Object element)
      Replaces the element at the specified position with the specified element
      
          DataList array = new DataList();
          array.add(-1); // [-1]
          array.add(2); // [-1,2]
          array.set(0, 1); // [1,2]
          array.set(4, 3); // [1,2,null,null,3]
          array.set(-1, -1); // [1,2,null,null,-1]
          array.set(-2, -2); // [1,2,null,-2,-1]
          array.set(-6, -6); // [-6,1,2,null,-2,-1]
       
      指定者:
      set 在接口中 List<Object>
      覆盖:
      set 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to replace
      element - element to be stored at the specified position
      返回:
      the element previously at the specified position
      从以下版本开始:
      2.0.3
    • getDataList

      public DataList getDataList(int index)
      Returns the DataList at the specified location in this DataList.
      参数:
      index - index of the element to return
      返回:
      DataList or null
      抛出:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getDataMap

      public DataMap getDataMap(int index)
      Returns the DataMap at the specified location in this DataList.
      参数:
      index - index of the element to return
      返回:
      DataMap or null
      抛出:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getString

      public String getString(int index)
      Returns the String at the specified location in this DataList.
      覆盖:
      getString 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      String or null
      抛出:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getDouble

      public Double getDouble(int index)
      Returns the Double at the specified location in this DataList.
      覆盖:
      getDouble 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      Double or null
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable double
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to Double
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getDoubleValue

      public double getDoubleValue(int index)
      Returns a double value at the specified location in this DataList.
      覆盖:
      getDoubleValue 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      double
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable double
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to double value
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getFloat

      public Float getFloat(int index)
      Returns the Float at the specified location in this DataList.
      覆盖:
      getFloat 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      Float or null
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable float
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to Float
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getFloatValue

      public float getFloatValue(int index)
      Returns a float value at the specified location in this DataList.
      覆盖:
      getFloatValue 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      float
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable float
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to float value
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getLong

      public Long getLong(int index)
      Returns the Long at the specified location in this DataList.
      覆盖:
      getLong 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      Long or null
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable long
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to Long
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getLongValue

      public long getLongValue(int index)
      Returns a long value at the specified location in this DataList.
      覆盖:
      getLongValue 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      long
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable long
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to long value
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getInteger

      public Integer getInteger(int index)
      Returns the Integer at the specified location in this DataList.
      覆盖:
      getInteger 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      Integer or null
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable int
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to Integer
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getIntValue

      public int getIntValue(int index)
      Returns an int value at the specified location in this DataList.
      覆盖:
      getIntValue 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      int
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable int
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to int value
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getShort

      public Short getShort(int index)
      Returns the Short at the specified location in this DataList.
      覆盖:
      getShort 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      Short or null
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable short
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to Short
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getShortValue

      public short getShortValue(int index)
      Returns a short value at the specified location in this DataList.
      覆盖:
      getShortValue 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      short
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable short
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to short value
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getByte

      public Byte getByte(int index)
      Returns the Byte at the specified location in this DataList.
      覆盖:
      getByte 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      Byte or null
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable byte
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to Byte
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getByteValue

      public byte getByteValue(int index)
      Returns a byte value at the specified location in this DataList.
      覆盖:
      getByteValue 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      byte
      抛出:
      NumberFormatException - If the value of get is String and it contains no parsable byte
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to byte value
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getBoolean

      public Boolean getBoolean(int index)
      Returns the Boolean at the specified location in this DataList.
      覆盖:
      getBoolean 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      Boolean or null
      抛出:
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to Boolean
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getBooleanValue

      public boolean getBooleanValue(int index)
      Returns a boolean value at the specified location in this DataList.
      覆盖:
      getBooleanValue 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      boolean
      抛出:
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to boolean value
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getBigInteger

      public BigInteger getBigInteger(int index)
      Returns the BigInteger at the specified location in this DataList.
      覆盖:
      getBigInteger 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      BigInteger or null
      抛出:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to BigInteger
      NumberFormatException - If the value of get is String and it is not a valid representation of BigInteger
    • getBigDecimal

      public BigDecimal getBigDecimal(int index)
      Returns the BigDecimal at the specified location in this DataList.
      覆盖:
      getBigDecimal 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      BigDecimal or null
      抛出:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
      com.alibaba.fastjson2.JSONException - Unsupported type conversion to BigDecimal
      NumberFormatException - If the value of get is String and it is not a valid representation of BigDecimal
    • getDate

      public Date getDate(int index)
      Returns the Date at the specified location in this DataList.
      覆盖:
      getDate 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      Date or null
      抛出:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getInstant

      public java.time.Instant getInstant(int index)
      Returns the Instant at the specified location in this DataList.
      覆盖:
      getInstant 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      返回:
      Instant or null
      抛出:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • toString

      public String toString(com.alibaba.fastjson2.JSONWriter.Feature... features)
      Serialize to JSON String
      覆盖:
      toString 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      features - features to be enabled in serialization
      返回:
      JSON String
    • toJSONString

      public String toJSONString(com.alibaba.fastjson2.JSONWriter.Feature... features)
      Serialize to JSON String
      覆盖:
      toJSONString 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      features - features to be enabled in serialization
      返回:
      JSON String
    • toJSONBBytes

      public byte[] toJSONBBytes(com.alibaba.fastjson2.JSONWriter.Feature... features)
      Serialize to JSONB bytes
      覆盖:
      toJSONBBytes 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      features - features to be enabled in serialization
      返回:
      JSONB bytes
    • to

      public <T> T to(Type type)
      Convert this DataList to the specified Object
      
       DataList array = ...
       List<User> users = array.to(new TypeReference<ArrayList<User>>(){}.getType());
       
      覆盖:
      to 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      type - specify the Type to be converted
      从以下版本开始:
      2.0.4
    • to

      public <T> T to(Class<T> type)
      覆盖:
      to 在类中 com.alibaba.fastjson2.JSONArray
      类型参数:
      T - 泛型
      参数:
      type - 类型
      返回:
      T
    • toJavaObject

      public <T> T toJavaObject(Type type)
      已过时。
      since 2.0.4, please use to(Type)
      Convert this DataList to the specified Object
      覆盖:
      toJavaObject 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      type - specify the Type to be converted
    • toList

      public <T> List<T> toList(Class<T> itemClass, com.alibaba.fastjson2.JSONReader.Feature... features)
      Convert all the members of this DataList into the specified Object.
      
       String json = "[{\"id\": 1, \"name\": \"fastjson\"}, {\"id\": 2, \"name\": \"fastjson2\"}]";
       DataList array = JSON.parseArray(json);
       List<User> users = array.toList(User.class);
       
      覆盖:
      toList 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      itemClass - specify the Class<T> to be converted
      features - features to be enabled in parsing
      从以下版本开始:
      2.0.4
    • toArray

      public <T> T[] toArray(Class<T> itemClass, com.alibaba.fastjson2.JSONReader.Feature... features)
      Convert all the members of this DataList into the specified Object.
      
       String json = "[{\"id\": 1, \"name\": \"fastjson\"}, {\"id\": 2, \"name\": \"fastjson2\"}]";
       DataList array = JSON.parseArray(json);
       List<User> users = array.toList(User.class);
       
      覆盖:
      toArray 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      itemClass - specify the Class<T> to be converted
      features - features to be enabled in parsing
      从以下版本开始:
      2.0.4
    • toJavaList

      public <T> List<T> toJavaList(Class<T> clazz, com.alibaba.fastjson2.JSONReader.Feature... features)
      已过时。
      since 2.0.4, please use toList(Class, JSONReader.Feature...)
      Convert all the members of this DataList into the specified Object.
      覆盖:
      toJavaList 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      clazz - specify the Class<T> to be converted
      features - features to be enabled in parsing
    • getObject

      public <T> T getObject(int index, Type type, com.alibaba.fastjson2.JSONReader.Feature... features)
      Returns the result of the Type converter conversion of the element at the specified position in this DataList.
      
       DataList array = ...
       User user = array.getObject(0, TypeReference<HashMap<String ,User>>(){}.getType());
       
      覆盖:
      getObject 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      type - specify the Type to be converted
      features -
      返回:
      <T> or null
      抛出:
      com.alibaba.fastjson2.JSONException - If no suitable conversion method is found
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getObject

      public <T> T getObject(int index, Class<T> type, com.alibaba.fastjson2.JSONReader.Feature... features)
      Returns the result of the Type converter conversion of the element at the specified position in this DataList.

      User user = DataList.getObject(0, User.class);

      覆盖:
      getObject 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index - index of the element to return
      type - specify the Class to be converted
      features -
      返回:
      <T> or null
      抛出:
      com.alibaba.fastjson2.JSONException - If no suitable conversion method is found
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • getObject

      public <T> T getObject(int index, java.util.function.Function<com.alibaba.fastjson2.JSONObject,T> creator)
      覆盖:
      getObject 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index -
      creator -
      从以下版本开始:
      2.0.3
    • fluentAdd

      public DataList fluentAdd(Object element)
      Chained addition of elements
       DataList array = new DataList().fluentAdd(1).fluentAdd(2).fluentAdd(3);
       
      覆盖:
      fluentAdd 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      element - element to be appended to this list
    • fluentClear

      public DataList fluentClear()
      覆盖:
      fluentClear 在类中 com.alibaba.fastjson2.JSONArray
      从以下版本开始:
      2.0.3
    • fluentRemove

      public DataList fluentRemove(int index)
      覆盖:
      fluentRemove 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index -
      从以下版本开始:
      2.0.3
    • fluentSet

      public DataList fluentSet(int index, Object element)
      覆盖:
      fluentSet 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      index -
      element -
      从以下版本开始:
      2.0.3
    • fluentRemove

      public DataList fluentRemove(Object o)
      覆盖:
      fluentRemove 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      o -
      从以下版本开始:
      2.0.3
    • fluentRemoveAll

      public DataList fluentRemoveAll(Collection<?> c)
      覆盖:
      fluentRemoveAll 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      c -
      从以下版本开始:
      2.0.3
    • fluentAddAll

      public DataList fluentAddAll(Collection<?> c)
      覆盖:
      fluentAddAll 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      c -
      从以下版本开始:
      2.0.3
    • isValid

      public boolean isValid(com.alibaba.fastjson2.schema.JSONSchema schema)
      覆盖:
      isValid 在类中 com.alibaba.fastjson2.JSONArray
      参数:
      schema -
      从以下版本开始:
      2.0.3
    • trimToSize

      public void trimToSize()
      Trims the capacity of this ArrayList instance to be the list's current size. An application can use this operation to minimize the storage of an ArrayList instance.
      覆盖:
      trimToSize 在类中 ArrayList<Object>
    • ensureCapacity

      public void ensureCapacity(int minCapacity)
      Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
      覆盖:
      ensureCapacity 在类中 ArrayList<Object>
      参数:
      minCapacity - the desired minimum capacity
    • size

      public int size()
      Returns the number of elements in this list.
      指定者:
      size 在接口中 Collection<Object>
      指定者:
      size 在接口中 List<Object>
      覆盖:
      size 在类中 ArrayList<Object>
      返回:
      the number of elements in this list
    • isEmpty

      public boolean isEmpty()
      Returns true if this list contains no elements.
      指定者:
      isEmpty 在接口中 Collection<Object>
      指定者:
      isEmpty 在接口中 List<Object>
      覆盖:
      isEmpty 在类中 ArrayList<Object>
      返回:
      true if this list contains no elements
    • contains

      public boolean contains(Object o)
      Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that Objects.equals(o, e).
      指定者:
      contains 在接口中 Collection<Object>
      指定者:
      contains 在接口中 List<Object>
      覆盖:
      contains 在类中 ArrayList<Object>
      参数:
      o - element whose presence in this list is to be tested
      返回:
      true if this list contains the specified element
    • indexOf

      public int indexOf(Object o)
      Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the lowest index i such that Objects.equals(o, get(i)), or -1 if there is no such index.
      指定者:
      indexOf 在接口中 List<Object>
      覆盖:
      indexOf 在类中 ArrayList<Object>
      参数:
      o -
    • lastIndexOf

      public int lastIndexOf(Object o)
      Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the highest index i such that Objects.equals(o, get(i)), or -1 if there is no such index.
      指定者:
      lastIndexOf 在接口中 List<Object>
      覆盖:
      lastIndexOf 在类中 ArrayList<Object>
      参数:
      o -
    • toArray

      public Object[] toArray()
      Returns an array containing all of the elements in this list in proper sequence (from first to last element).

      The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array). The caller is thus free to modify the returned array.

      This method acts as bridge between array-based and collection-based APIs.

      指定者:
      toArray 在接口中 Collection<Object>
      指定者:
      toArray 在接口中 List<Object>
      覆盖:
      toArray 在类中 ArrayList<Object>
      返回:
      an array containing all of the elements in this list in proper sequence
    • toArray

      public <T> T[] toArray(T[] a)
      Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list.

      If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the collection is set to null. (This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.)

      指定者:
      toArray 在接口中 Collection<Object>
      指定者:
      toArray 在接口中 List<Object>
      覆盖:
      toArray 在类中 ArrayList<Object>
      参数:
      a - the array into which the elements of the list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
      返回:
      an array containing the elements of the list
      抛出:
      ArrayStoreException - if the runtime type of the specified array is not a supertype of the runtime type of every element in this list
      NullPointerException - if the specified array is null
    • get

      public Object get(int index)
      Returns the element at the specified position in this list.
      指定者:
      get 在接口中 List<Object>
      覆盖:
      get 在类中 ArrayList<Object>
      参数:
      index - index of the element to return
      返回:
      the element at the specified position in this list
      抛出:
      IndexOutOfBoundsException
    • add

      public boolean add(Object o)
      Appends the specified element to the end of this list.
      指定者:
      add 在接口中 Collection<Object>
      指定者:
      add 在接口中 List<Object>
      覆盖:
      add 在类中 ArrayList<Object>
      参数:
      o - element to be appended to this list
      返回:
      true (as specified by Collection.add(E))
    • add

      public void add(int index, Object element)
      Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
      指定者:
      add 在接口中 List<Object>
      覆盖:
      add 在类中 ArrayList<Object>
      参数:
      index - index at which the specified element is to be inserted
      element - element to be inserted
      抛出:
      IndexOutOfBoundsException
    • remove

      public Object remove(int index)
      Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).
      指定者:
      remove 在接口中 List<Object>
      覆盖:
      remove 在类中 ArrayList<Object>
      参数:
      index - the index of the element to be removed
      返回:
      the element that was removed from the list
      抛出:
      IndexOutOfBoundsException
    • equals

      public boolean equals(Object o)
      指定者:
      equals 在接口中 Collection<Object>
      指定者:
      equals 在接口中 List<Object>
      覆盖:
      equals 在类中 ArrayList<Object>
      参数:
      o -
    • hashCode

      public int hashCode()
      指定者:
      hashCode 在接口中 Collection<Object>
      指定者:
      hashCode 在接口中 List<Object>
      覆盖:
      hashCode 在类中 ArrayList<Object>
    • remove

      public boolean remove(Object o)
      Removes the first occurrence of the specified element from this list, if it is present. If the list does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that Objects.equals(o, get(i)) (if such an element exists). Returns true if this list contained the specified element (or equivalently, if this list changed as a result of the call).
      指定者:
      remove 在接口中 Collection<Object>
      指定者:
      remove 在接口中 List<Object>
      覆盖:
      remove 在类中 ArrayList<Object>
      参数:
      o - element to be removed from this list, if present
      返回:
      true if this list contained the specified element
    • clear

      public void clear()
      Removes all of the elements from this list. The list will be empty after this call returns.
      指定者:
      clear 在接口中 Collection<Object>
      指定者:
      clear 在接口中 List<Object>
      覆盖:
      clear 在类中 ArrayList<Object>
    • addAll

      public boolean addAll(Collection<?> c)
      Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's Iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this list, and this list is nonempty.)
      指定者:
      addAll 在接口中 Collection<Object>
      指定者:
      addAll 在接口中 List<Object>
      覆盖:
      addAll 在类中 ArrayList<Object>
      参数:
      c - collection containing elements to be added to this list
      返回:
      true if this list changed as a result of the call
      抛出:
      NullPointerException - if the specified collection is null
    • addAll

      public boolean addAll(int index, Collection<?> c)
      Inserts all of the elements in the specified collection into this list, starting at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the list in the order that they are returned by the specified collection's iterator.
      指定者:
      addAll 在接口中 List<Object>
      覆盖:
      addAll 在类中 ArrayList<Object>
      参数:
      index - index at which to insert the first element from the specified collection
      c - collection containing elements to be added to this list
      返回:
      true if this list changed as a result of the call
      抛出:
      IndexOutOfBoundsException
      NullPointerException - if the specified collection is null
    • removeRange

      protected void removeRange(int fromIndex, int toIndex)
      Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the list by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)
      覆盖:
      removeRange 在类中 ArrayList<Object>
      参数:
      fromIndex -
      toIndex -
      抛出:
      IndexOutOfBoundsException - if fromIndex or toIndex is out of range (fromIndex < 0 || toIndex > size() || toIndex < fromIndex)
    • removeAll

      public boolean removeAll(Collection<?> c)
      Removes from this list all of its elements that are contained in the specified collection.
      指定者:
      removeAll 在接口中 Collection<Object>
      指定者:
      removeAll 在接口中 List<Object>
      覆盖:
      removeAll 在类中 ArrayList<Object>
      参数:
      c - collection containing elements to be removed from this list
      返回:
      true if this list changed as a result of the call
      抛出:
      ClassCastException - if the class of an element of this list is incompatible with the specified collection (optional)
      NullPointerException - if this list contains a null element and the specified collection does not permit null elements (optional), or if the specified collection is null
      另请参阅:
    • retainAll

      public boolean retainAll(Collection<?> c)
      Retains only the elements in this list that are contained in the specified collection. In other words, removes from this list all of its elements that are not contained in the specified collection.
      指定者:
      retainAll 在接口中 Collection<Object>
      指定者:
      retainAll 在接口中 List<Object>
      覆盖:
      retainAll 在类中 ArrayList<Object>
      参数:
      c - collection containing elements to be retained in this list
      返回:
      true if this list changed as a result of the call
      抛出:
      ClassCastException - if the class of an element of this list is incompatible with the specified collection (optional)
      NullPointerException - if this list contains a null element and the specified collection does not permit null elements (optional), or if the specified collection is null
      另请参阅:
    • listIterator

      public ListIterator<Object> listIterator(int index)
      Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list. The specified index indicates the first element that would be returned by an initial call to next. An initial call to previous would return the element with the specified index minus one.

      The returned list iterator is fail-fast.

      指定者:
      listIterator 在接口中 List<Object>
      覆盖:
      listIterator 在类中 ArrayList<Object>
      参数:
      index -
      抛出:
      IndexOutOfBoundsException
    • listIterator

      public ListIterator<Object> listIterator()
      Returns a list iterator over the elements in this list (in proper sequence).

      The returned list iterator is fail-fast.

      指定者:
      listIterator 在接口中 List<Object>
      覆盖:
      listIterator 在类中 ArrayList<Object>
      另请参阅:
    • iterator

      public Iterator<Object> iterator()
      Returns an iterator over the elements in this list in proper sequence.

      The returned iterator is fail-fast.

      指定者:
      iterator 在接口中 Collection<Object>
      指定者:
      iterator 在接口中 Iterable<Object>
      指定者:
      iterator 在接口中 List<Object>
      覆盖:
      iterator 在类中 ArrayList<Object>
      返回:
      an iterator over the elements in this list in proper sequence
    • subList

      public List<Object> subList(int fromIndex, int toIndex)
      Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations.

      This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:

            list.subList(from, to).clear();
       
      Similar idioms may be constructed for indexOf(Object) and lastIndexOf(Object), and all of the algorithms in the Collections class can be applied to a subList.

      The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

      指定者:
      subList 在接口中 List<Object>
      覆盖:
      subList 在类中 ArrayList<Object>
      参数:
      fromIndex -
      toIndex -
      抛出:
      IndexOutOfBoundsException
      IllegalArgumentException
    • forEach

      public void forEach(java.util.function.Consumer<? super Object> action)
      指定者:
      forEach 在接口中 Iterable<Object>
      覆盖:
      forEach 在类中 ArrayList<Object>
      参数:
      action -
      抛出:
      NullPointerException
    • spliterator

      public Spliterator<Object> spliterator()
      Creates a late-binding and fail-fast Spliterator over the elements in this list.

      The Spliterator reports Spliterator.SIZED, Spliterator.SUBSIZED, and Spliterator.ORDERED. Overriding implementations should document the reporting of additional characteristic values.

      指定者:
      spliterator 在接口中 Collection<Object>
      指定者:
      spliterator 在接口中 Iterable<Object>
      指定者:
      spliterator 在接口中 List<Object>
      覆盖:
      spliterator 在类中 ArrayList<Object>
      返回:
      a Spliterator over the elements in this list
      从以下版本开始:
      1.8
    • removeIf

      public boolean removeIf(java.util.function.Predicate<? super Object> filter)
      指定者:
      removeIf 在接口中 Collection<Object>
      覆盖:
      removeIf 在类中 ArrayList<Object>
      参数:
      filter -
      抛出:
      NullPointerException
    • replaceAll

      public void replaceAll(java.util.function.UnaryOperator<Object> operator)
      指定者:
      replaceAll 在接口中 List<Object>
      覆盖:
      replaceAll 在类中 ArrayList<Object>
      参数:
      operator - the operator to apply to each element
    • sort

      public void sort(Comparator<? super Object> c)
      指定者:
      sort 在接口中 List<Object>
      覆盖:
      sort 在类中 ArrayList<Object>
      参数:
      c - the Comparator used to compare list elements. A null value indicates that the elements' natural ordering should be used
    • containsAll

      public boolean containsAll(Collection<?> c)
      指定者:
      containsAll 在接口中 Collection<Object>
      指定者:
      containsAll 在接口中 List<Object>
      覆盖:
      containsAll 在类中 AbstractCollection<Object>
      参数:
      c -
      抛出:
      ClassCastException
      NullPointerException
      另请参阅:
    • toArray

      public <T> T[] toArray(java.util.function.IntFunction<T[]> generator)
      Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array.

      If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.

      指定者:
      toArray 在接口中 Collection<Object>
      参数:
      generator - a function which produces a new array of the desired type and the provided length
      返回:
      an array containing all of the elements in this collection
      抛出:
      ArrayStoreException - if the runtime type of any element in this collection is not assignable to the runtime component type of the generated array
      NullPointerException - if the generator function is null
      从以下版本开始:
      11
    • stream

      public java.util.stream.Stream<Object> stream()
      Returns a sequential Stream with this collection as its source.

      This method should be overridden when the spliterator() method cannot return a spliterator that is IMMUTABLE, CONCURRENT, or late-binding. (See spliterator() for details.)

      指定者:
      stream 在接口中 Collection<Object>
      返回:
      a sequential Stream over the elements in this collection
      从以下版本开始:
      1.8
    • parallelStream

      public java.util.stream.Stream<Object> parallelStream()
      Returns a possibly parallel Stream with this collection as its source. It is allowable for this method to return a sequential stream.

      This method should be overridden when the spliterator() method cannot return a spliterator that is IMMUTABLE, CONCURRENT, or late-binding. (See spliterator() for details.)

      指定者:
      parallelStream 在接口中 Collection<Object>
      返回:
      a possibly parallel Stream over the elements in this collection
      从以下版本开始:
      1.8
    • toString

      public String toString()
      覆盖:
      toString 在类中 com.alibaba.fastjson2.JSONArray
    • clone

      public DataList clone()
      覆盖:
      clone 在类中 com.alibaba.fastjson2.JSONArray