Class IntMapper<T>

  • All Implemented Interfaces:
    java.lang.Iterable<T>, org.apache.poi.common.Duplicatable

    public class IntMapper<T>
    extends java.lang.Object
    implements org.apache.poi.common.Duplicatable, java.lang.Iterable<T>
    A List of objects that are indexed AND keyed by an int; also allows for getting the index of a value in the list

    I am happy is someone wants to re-implement this without using the internal list and hashmap. If so could you please make sure that you can add elements half way into the list and have the value-key mappings update

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(T value)
      Appends the specified element to the end of this list
      IntMapper<T> copy()  
      T get​(int index)  
      java.util.List<T> getElements()  
      int getIndex​(T o)  
      java.util.Iterator<T> iterator()  
      int size()  
      java.util.Spliterator<T> spliterator()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • IntMapper

        public IntMapper()
        create an IntMapper of default size
      • IntMapper

        public IntMapper​(int initialCapacity)
      • IntMapper

        public IntMapper​(IntMapper<T> other)
    • Method Detail

      • add

        public boolean add​(T value)
        Appends the specified element to the end of this list
        Parameters:
        value - element to be appended to this list.
        Returns:
        true (as per the general contract of the Collection.add method).
      • size

        public int size()
      • get

        public T get​(int index)
      • getIndex

        public int getIndex​(T o)
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>
      • spliterator

        public java.util.Spliterator<T> spliterator()
        Specified by:
        spliterator in interface java.lang.Iterable<T>
        Since:
        POI 5.2.0
      • copy

        public IntMapper<T> copy()
        Specified by:
        copy in interface org.apache.poi.common.Duplicatable
      • getElements

        public java.util.List<T> getElements()