/** * Returns a string representation of this collection. * The string representation consists of the string representations * of the collection's elements in the order they are returned by * its iterator, enclosed in square brackets ({@code "[]"}). * Adjacent elements are separated by the characters {@code ", "} * (comma and space). Elements are converted to strings as by * {@link String#valueOf(Object)}. * * @return a string representation of this collection */ public final String toString() { final StringBuilder sb = new StringBuilder(); sb.append('['); final Iterator<E> it = iterator(); if (it.hasNext()) { for (; ; ) { final Object e = it.next(); sb.append(e == this ? "(this Collection)" : e); if (!it.hasNext()) break; sb.append(',').append(' '); } } return sb.append(']').toString(); }
/** * Returns a string representation of this collection. * The string representation consists of the string representations * of the collection's elements in the order they are returned by * its iterator, enclosed in square brackets ({@code "[]"}). * Adjacent elements are separated by the characters {@code ", "} * (comma and space). Elements are converted to strings as by * {@link String#valueOf(Object)}. * * @return a string representation of this collection */ public final String toString() { final StringBuilder sb = new StringBuilder(); sb.append('['); final Iterator<E> it = iterator(); if (it.hasNext()) { for (; ; ) { final Object e = it.next(); sb.append(e == this ? "(this Collection)" : e); if (!it.hasNext()) break; sb.append(',').append(' '); } } return sb.append(']').toString(); }
/** * Returns a string representation of this collection. * The string representation consists of the string representations * of the collection's elements in the order they are returned by * its iterator, enclosed in square brackets ({@code "[]"}). * Adjacent elements are separated by the characters {@code ", "} * (comma and space). Elements are converted to strings as by * {@link String#valueOf(Object)}. * * @return a string representation of this collection */ public final String toString() { final StringBuilder sb = new StringBuilder(); sb.append('['); final Iterator<E> it = iterator(); if (it.hasNext()) { for (; ; ) { final Object e = it.next(); sb.append(e == this ? "(this Collection)" : e); if (!it.hasNext()) break; sb.append(',').append(' '); } } return sb.append(']').toString(); }
/** * Returns a string representation of this collection. * The string representation consists of the string representations * of the collection's elements in the order they are returned by * its iterator, enclosed in square brackets ({@code "[]"}). * Adjacent elements are separated by the characters {@code ", "} * (comma and space). Elements are converted to strings as by * {@link String#valueOf(Object)}. * * @return a string representation of this collection */ public final String toString() { final StringBuilder sb = new StringBuilder(); sb.append('['); final Iterator<E> it = iterator(); if (it.hasNext()) { for (; ; ) { final Object e = it.next(); sb.append(e == this ? "(this Collection)" : e); if (!it.hasNext()) break; sb.append(',').append(' '); } } return sb.append(']').toString(); }
/** * Returns a string representation of this collection. * The string representation consists of the string representations * of the collection's elements in the order they are returned by * its iterator, enclosed in square brackets ({@code "[]"}). * Adjacent elements are separated by the characters {@code ", "} * (comma and space). Elements are converted to strings as by * {@link String#valueOf(Object)}. * * @return a string representation of this collection */ public final String toString() { final StringBuilder sb = new StringBuilder(); sb.append('['); final Iterator<E> it = iterator(); if (it.hasNext()) { for (; ; ) { final Object e = it.next(); sb.append(e == this ? "(this Collection)" : e); if (!it.hasNext()) break; sb.append(',').append(' '); } } return sb.append(']').toString(); }
/** * Returns a string representation of this collection. * The string representation consists of the string representations * of the collection's elements in the order they are returned by * its iterator, enclosed in square brackets ({@code "[]"}). * Adjacent elements are separated by the characters {@code ", "} * (comma and space). Elements are converted to strings as by * {@link String#valueOf(Object)}. * * @return a string representation of this collection */ public final String toString() { final StringBuilder sb = new StringBuilder(); sb.append('['); final Iterator<E> it = iterator(); if (it.hasNext()) { for (; ; ) { final Object e = it.next(); sb.append(e == this ? "(this Collection)" : e); if (!it.hasNext()) break; sb.append(',').append(' '); } } return sb.append(']').toString(); }
public final boolean removeAll(final Collection<?> c) { boolean modified = false; for (final Iterator<E> it = iterator(); it.hasNext(); ) { if (c.contains(it.next())) { it.remove(); modified = true; } } return modified; }
public final boolean containsAll(final Collection<?> c) { if (c != this) { for (final Object e : c) { if (e == null || !contains(e)) return false; } } return true; }
public final boolean retainAll(final Collection<?> c) { boolean modified = false; for (final Iterator<E> it = iterator(); it.hasNext(); ) { if (!c.contains(it.next())) { it.remove(); modified = true; } } return modified; }
public final boolean retainAll(final Collection<?> c) { boolean modified = false; for (final Iterator<E> it = iterator(); it.hasNext(); ) { if (!c.contains(it.next())) { it.remove(); modified = true; } } return modified; }
public final boolean retainAll(final Collection<?> c) { boolean modified = false; for (final Iterator<E> it = iterator(); it.hasNext(); ) { if (!c.contains(it.next())) { it.remove(); modified = true; } } return modified; }
public final boolean containsAll(final Collection<?> c) { if (c != this) { for (final Object e : c) { if (e == null || !contains(e)) return false; } } return true; }
public final boolean removeAll(final Collection<?> c) { boolean modified = false; for (final Iterator<E> it = iterator(); it.hasNext(); ) { if (c.contains(it.next())) { it.remove(); modified = true; } } return modified; }
public final boolean removeAll(final Collection<?> c) { boolean modified = false; for (final Iterator<E> it = iterator(); it.hasNext(); ) { if (c.contains(it.next())) { it.remove(); modified = true; } } return modified; }
public final boolean removeAll(final Collection<?> c) { boolean modified = false; for (final Iterator<E> it = iterator(); it.hasNext(); ) { if (c.contains(it.next())) { it.remove(); modified = true; } } return modified; }
public final boolean retainAll(final Collection<?> c) { boolean modified = false; for (final Iterator<E> it = iterator(); it.hasNext(); ) { if (!c.contains(it.next())) { it.remove(); modified = true; } } return modified; }
public final boolean containsAll(final Collection<?> c) { if (c != this) { for (final Object e : c) { if (e == null || !contains(e)) return false; } } return true; }
public final boolean containsAll(final Collection<?> c) { if (c != this) { for (final Object e : c) { if (e == null || !contains(e)) return false; } } return true; }
public final boolean retainAll(final Collection<?> c) { boolean modified = false; for (final Iterator<E> it = iterator(); it.hasNext(); ) { if (!c.contains(it.next())) { it.remove(); modified = true; } } return modified; }
public final boolean removeAll(final Collection<?> c) { boolean modified = false; for (final Iterator<E> it = iterator(); it.hasNext(); ) { if (c.contains(it.next())) { it.remove(); modified = true; } } return modified; }