Interface PrimitiveIterable

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void appendString​(java.lang.Appendable appendable)
      Prints a string representation of this collection onto the given Appendable.
      default void appendString​(java.lang.Appendable appendable, java.lang.String separator)
      Prints a string representation of this collection onto the given Appendable.
      void appendString​(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)
      Prints a string representation of this collection onto the given Appendable.
      default boolean isEmpty()
      Returns true if this iterable has zero items.
      default java.lang.String makeString()
      Returns a string representation of this collection by delegating to makeString(String) and defaulting the separator parameter to the characters ", " (comma and space).
      default java.lang.String makeString​(java.lang.String separator)
      Returns a string representation of this collection by delegating to makeString(String, String, String) and defaulting the start and end parameters to "" (the empty String).
      default java.lang.String makeString​(java.lang.String start, java.lang.String separator, java.lang.String end)
      Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.
      default boolean notEmpty()
      The English equivalent of !this.isEmpty()
      int size()
      Returns the number of items in this iterable.
      java.lang.String toString()
      Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.
    • Method Detail

      • size

        int size()
        Returns the number of items in this iterable.
        Since:
        3.0
      • isEmpty

        default boolean isEmpty()
        Returns true if this iterable has zero items.
        Since:
        3.0
      • notEmpty

        default boolean notEmpty()
        The English equivalent of !this.isEmpty()
        Since:
        3.0
      • toString

        java.lang.String toString()
        Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.
         Assert.assertEquals("[]", IntLists.mutable.empty().toString());
         Assert.assertEquals("[1]", IntLists.mutable.with(1).toString());
         Assert.assertEquals("[1, 2, 3]", IntLists.mutable.with(1, 2, 3).toString());
         
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this PrimitiveIterable
        See Also:
        AbstractCollection.toString()
      • makeString

        default java.lang.String makeString()
        Returns a string representation of this collection by delegating to makeString(String) and defaulting the separator parameter to the characters ", " (comma and space).
        Returns:
        a string representation of this collection.
        Since:
        3.0
      • makeString

        default java.lang.String makeString​(java.lang.String separator)
        Returns a string representation of this collection by delegating to makeString(String, String, String) and defaulting the start and end parameters to "" (the empty String).
        Returns:
        a string representation of this collection.
        Since:
        3.0
      • makeString

        default java.lang.String makeString​(java.lang.String start,
                                            java.lang.String separator,
                                            java.lang.String end)
        Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.
        Returns:
        a string representation of this collection.
        Since:
        3.0
      • appendString

        default void appendString​(java.lang.Appendable appendable)
        Prints a string representation of this collection onto the given Appendable. Prints the string returned by makeString().
        Since:
        3.0
      • appendString

        default void appendString​(java.lang.Appendable appendable,
                                  java.lang.String separator)
        Prints a string representation of this collection onto the given Appendable. Prints the string returned by makeString(String).
        Since:
        3.0
      • appendString

        void appendString​(java.lang.Appendable appendable,
                          java.lang.String start,
                          java.lang.String separator,
                          java.lang.String end)
        Prints a string representation of this collection onto the given Appendable. Prints the string returned by makeString(String, String, String).
        Since:
        3.0