Class ShortObjGapList.ImmutableShortObjGapList

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Short>, java.util.Collection<java.lang.Short>, java.util.List<java.lang.Short>, java.util.RandomAccess, ICollection<java.lang.Short>, IListable<java.lang.Short>
    Enclosing class:
    ShortObjGapList

    protected static class ShortObjGapList.ImmutableShortObjGapList
    extends ShortObjGapList
    An immutable version of a GapList. Note that the client cannot change the list, but the content may change if the underlying list is changed.
    See Also:
    Serialized Form
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        UID for serialization
        See Also:
        Constant Field Values
    • Constructor Detail

      • ImmutableShortObjGapList

        protected ImmutableShortObjGapList​(ShortObjGapList that)
        Private constructor used internally.
        Parameters:
        that - list to create an immutable view of
    • Method Detail

      • doAdd

        protected boolean doAdd​(int index,
                                java.lang.Short elem)
        Description copied from class: IList
        Helper method for adding an element to the list. This is the only method which really adds an element. Override if you need to validity checks before adding.
        Overrides:
        doAdd in class ShortObjGapList
        Parameters:
        index - index where element should be added (-1 means it is up to the implementation to choose the index)
        elem - element to add
        Returns:
        true if element has been added, false otherwise
      • doSet

        protected java.lang.Short doSet​(int index,
                                        java.lang.Short elem)
        Description copied from class: IList
        Helper method for setting an element in the list. This is the only method which really sets an element. Override if you need to validity checks before setting.
        Overrides:
        doSet in class ShortObjGapList
        Parameters:
        index - index where element will be placed
        elem - element to set
        Returns:
        old element which was at the position
      • doReSet

        protected java.lang.Short doReSet​(int index,
                                          java.lang.Short elem)
        Description copied from class: IList
        Sets an element at specified position. This method is used internally if existing elements will be moved etc. Override if you need to validity checks.
        Overrides:
        doReSet in class ShortObjGapList
        Parameters:
        index - index where element will be placed
        elem - element to set
        Returns:
        old element which was at the position
      • doRemove

        protected java.lang.Short doRemove​(int index)
        Description copied from class: IList
        Helper method to remove an element. This is the only method which really removes an element. Override if you need to validity checks before removing.
        Overrides:
        doRemove in class ShortObjGapList
        Parameters:
        index - index of element to remove
        Returns:
        removed element
      • doRemoveAll

        protected void doRemoveAll​(int index,
                                   int len)
        Description copied from class: IList
        Remove specified range of elements from list.
        Overrides:
        doRemoveAll in class ShortObjGapList
        Parameters:
        index - index of first element to remove
        len - number of elements to remove
      • doModify

        protected void doModify()
        Description copied from class: IList
        This method is called internally before elements are allocated or freed. Override if you need to validity checks.
        Overrides:
        doModify in class IList<java.lang.Short>
      • error

        private void error()
        Throw exception if an attempt is made to change an immutable list.