Class Array<T extends FieldValue>

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<FieldValue>, java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>

    public final class Array<T extends FieldValue>
    extends CollectionFieldValue<T>
    implements java.util.List<T>
    FieldValue which encapsulates a Array value
    Author:
    Einar M R Rosenvinge
    • Constructor Detail

      • Array

        public Array​(DataType type)
      • Array

        public Array​(DataType type,
                     int initialCapacity)
      • Array

        public Array​(DataType type,
                     java.util.List<T> values)
    • Method Detail

      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<T extends FieldValue>
        Specified by:
        clear in interface java.util.List<T extends FieldValue>
        Specified by:
        clear in class FieldValue
      • assign

        public void assign​(java.lang.Object o)
        Description copied from class: FieldValue
        Assign this non-fieldvalue value to this field value. This is used to be able to assign ints to Integer field values and List to Array field values and such.

        Override to accept the specific types that should be legal.

        Specified by:
        assign in class FieldValue
      • getWrappedValue

        public java.lang.Object getWrappedValue()
        Description copied from class: FieldValue
        Used to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values. Complex types that can't be specified by simple java types just return themself.
        Overrides:
        getWrappedValue in class FieldValue
      • getValues

        public java.util.List<T> getValues()
      • getFieldValue

        public FieldValue getFieldValue​(int index)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class com.yahoo.vespa.objects.Identifiable
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Collection<T extends FieldValue>
        Specified by:
        equals in interface java.util.List<T extends FieldValue>
        Overrides:
        equals in class CompositeFieldValue
      • add

        public void add​(int index,
                        T o)
        Specified by:
        add in interface java.util.List<T extends FieldValue>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<T extends FieldValue>
        Specified by:
        remove in interface java.util.List<T extends FieldValue>
      • addAll

        public boolean addAll​(java.util.Collection<? extends T> c)
        Specified by:
        addAll in interface java.util.Collection<T extends FieldValue>
        Specified by:
        addAll in interface java.util.List<T extends FieldValue>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<T extends FieldValue>
        Specified by:
        containsAll in interface java.util.List<T extends FieldValue>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<T extends FieldValue>
        Specified by:
        toArray in interface java.util.List<T extends FieldValue>
      • toArray

        public <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface java.util.Collection<T extends FieldValue>
        Specified by:
        toArray in interface java.util.List<T extends FieldValue>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends T> c)
        Specified by:
        addAll in interface java.util.List<T extends FieldValue>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<T extends FieldValue>
        Specified by:
        retainAll in interface java.util.List<T extends FieldValue>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<T extends FieldValue>
        Specified by:
        removeAll in interface java.util.List<T extends FieldValue>
      • get

        public T get​(int index)
        Specified by:
        get in interface java.util.List<T extends FieldValue>
      • indexOf

        public int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List<T extends FieldValue>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List<T extends FieldValue>
      • listIterator

        public java.util.ListIterator<T> listIterator()
        Specified by:
        listIterator in interface java.util.List<T extends FieldValue>
      • listIterator

        public java.util.ListIterator<T> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<T extends FieldValue>
      • remove

        public T remove​(int index)
        Specified by:
        remove in interface java.util.List<T extends FieldValue>
      • set

        public T set​(int index,
                     T o)
        Specified by:
        set in interface java.util.List<T extends FieldValue>
      • subList

        public java.util.List<T> subList​(int fromIndex,
                                         int toIndex)
        Specified by:
        subList in interface java.util.List<T extends FieldValue>