Class Lists.StringAsImmutableList

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

    private static final class Lists.StringAsImmutableList
    extends ImmutableList<java.lang.Character>
    • Field Detail

      • string

        private final java.lang.String string
    • Constructor Detail

      • StringAsImmutableList

        StringAsImmutableList​(java.lang.String string)
    • Method Detail

      • indexOf

        public int indexOf​(@Nullable
                           java.lang.Object object)
        Specified by:
        indexOf in interface java.util.List<java.lang.Character>
        Overrides:
        indexOf in class ImmutableList<java.lang.Character>
      • lastIndexOf

        public int lastIndexOf​(@Nullable
                               java.lang.Object object)
        Specified by:
        lastIndexOf in interface java.util.List<java.lang.Character>
        Overrides:
        lastIndexOf in class ImmutableList<java.lang.Character>
      • subList

        public ImmutableList<java.lang.Character> subList​(int fromIndex,
                                                          int toIndex)
        Description copied from class: ImmutableList
        Returns an immutable list of the elements between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the empty immutable list is returned.)
        Specified by:
        subList in interface java.util.List<java.lang.Character>
        Overrides:
        subList in class ImmutableList<java.lang.Character>
      • isPartialView

        boolean isPartialView()
        Description copied from class: ImmutableCollection
        Returns true if this immutable collection's implementation contains references to user-created objects that aren't accessible via this collection's methods. This is generally used to determine whether copyOf implementations should make an explicit copy to avoid memory leaks.
        Specified by:
        isPartialView in class ImmutableCollection<java.lang.Character>
      • get

        public java.lang.Character get​(int index)
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<java.lang.Character>
        Specified by:
        size in interface java.util.List<java.lang.Character>
        Specified by:
        size in class java.util.AbstractCollection<java.lang.Character>