Class NodeVector<NODE>

  • All Implemented Interfaces:
    java.lang.Iterable<NODE>, java.util.Collection<NODE>, java.util.List<NODE>
    Direct Known Subclasses:
    InnerNodeVector, LeafNodeVector

    public abstract class NodeVector<NODE>
    extends java.lang.Object
    implements java.util.List<NODE>
    A NodeVector represents an array declared with '[]' in a config definition file. It is a List that stores nodes with a given type. A given default node must be given, and this node will be cloned as the NodeVector size are increased.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.ArrayList<NODE> vector  
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeVector()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, NODE element)  
      boolean add​(NODE o)  
      boolean addAll​(int index, java.util.Collection<? extends NODE> c)  
      boolean addAll​(java.util.Collection<? extends NODE> c)  
      void clear()  
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection<?> c)  
      boolean equals​(java.lang.Object o)  
      NODE get​(int index)  
      int hashCode()  
      int indexOf​(java.lang.Object o)  
      boolean isEmpty()  
      java.util.Iterator<NODE> iterator()  
      int lastIndexOf​(java.lang.Object o)  
      int length()
      Returns the number of elements in this NodeVector.
      java.util.ListIterator<NODE> listIterator()  
      java.util.ListIterator<NODE> listIterator​(int index)  
      NODE remove​(int index)  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean retainAll​(java.util.Collection<?> c)  
      NODE set​(int index, NODE element)  
      int size()  
      java.util.List<NODE> subList​(int fromIndex, int toIndex)  
      java.lang.Object[] toArray()  
      <T> T[] toArray​(T[] a)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        replaceAll, sort, spliterator
    • Field Detail

      • vector

        protected final java.util.ArrayList<NODE> vector
    • Constructor Detail

      • NodeVector

        public NodeVector()
    • Method Detail

      • length

        public int length()
        Returns the number of elements in this NodeVector. Alias for size().
        Returns:
        the number of elements in this NodeVector.
      • add

        public void add​(int index,
                        NODE element)
        Specified by:
        add in interface java.util.List<NODE>
      • add

        public boolean add​(NODE o)
        Specified by:
        add in interface java.util.Collection<NODE>
        Specified by:
        add in interface java.util.List<NODE>
      • addAll

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

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

        public void clear()
        Specified by:
        clear in interface java.util.Collection<NODE>
        Specified by:
        clear in interface java.util.List<NODE>
      • remove

        public NODE remove​(int index)
        Specified by:
        remove in interface java.util.List<NODE>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<NODE>
        Specified by:
        remove in interface java.util.List<NODE>
      • removeAll

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

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<NODE>
        Specified by:
        retainAll in interface java.util.List<NODE>
      • set

        public NODE set​(int index,
                        NODE element)
        Specified by:
        set in interface java.util.List<NODE>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<NODE>
        Specified by:
        contains in interface java.util.List<NODE>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<NODE>
        Specified by:
        containsAll in interface java.util.List<NODE>
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Collection<NODE>
        Specified by:
        equals in interface java.util.List<NODE>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<NODE>
        Specified by:
        hashCode in interface java.util.List<NODE>
        Overrides:
        hashCode in class java.lang.Object
      • get

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

        public int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List<NODE>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<NODE>
        Specified by:
        isEmpty in interface java.util.List<NODE>
      • iterator

        public java.util.Iterator<NODE> iterator()
        Specified by:
        iterator in interface java.util.Collection<NODE>
        Specified by:
        iterator in interface java.lang.Iterable<NODE>
        Specified by:
        iterator in interface java.util.List<NODE>
      • lastIndexOf

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

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

        public java.util.ListIterator<NODE> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<NODE>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<NODE>
        Specified by:
        size in interface java.util.List<NODE>
      • subList

        public java.util.List<NODE> subList​(int fromIndex,
                                            int toIndex)
        Specified by:
        subList in interface java.util.List<NODE>
      • toArray

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

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