Class Spaces.SpaceList

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.String>, java.util.Collection<java.lang.String>, java.util.List<java.lang.String>, java.util.RandomAccess
    Enclosing class:
    Spaces

    private static class Spaces.SpaceList
    extends java.util.concurrent.CopyOnWriteArrayList<java.lang.String>
    List whose ith entry is a string consisting of i spaces. It populates itself the first time you ask for a particular string, and caches the result.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SpaceList()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String get​(int index)  
      private void populate​(int newSize)
      Populates this list with all prefix strings of a given string.
      • Methods inherited from class java.util.concurrent.CopyOnWriteArrayList

        add, add, addAll, addAll, addAllAbsent, addIfAbsent, clear, clone, contains, containsAll, equals, forEach, hashCode, indexOf, indexOf, isEmpty, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

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

        parallelStream, stream, toArray
    • Constructor Detail

      • SpaceList

        private SpaceList()
    • Method Detail

      • get

        public java.lang.String get​(int index)
        Specified by:
        get in interface java.util.List<java.lang.String>
        Overrides:
        get in class java.util.concurrent.CopyOnWriteArrayList<java.lang.String>
      • populate

        private void populate​(int newSize)
        Populates this list with all prefix strings of a given string. All of the prefix strings share the same backing array of chars.