E - type of the elements in this collection@Generated(value="br.com.objectos.latest.processor.ConcreteClassProcessor") public abstract class AbstractBaseCollection<E> extends Object
abstract implementation of BaseCollection.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBaseCollection()
Sole constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Object first,
Object... more)
Returns
true if this collection contains all of the specified
elements. |
boolean |
containsAll(Collection<?> c)
Returns
true if this collection contains all of the elements in the
specified collection. |
void |
formatToString(StringBuilder toString,
int level)
Formats and appends to the
toString builder at the specified
indentation level a string representation of this collection. |
E |
getOnly()
Returns the only element in this collection or throws an exception if the
collection is empty or if the collection contains more than one element.
|
protected E |
getOnlyImpl()
This method is called by
getOnly() when the size is
size == 1. |
protected String |
indexName(int index,
int length)
Returns a name for the specified index having the specified length, result
is padded with zero digits if necessary.
|
boolean |
isEmpty()
Returns
true if this collection contains no elements. |
String |
join()
Returns a new string by joining together, in iteration order, the
string representation of each element in this collection.
|
String |
join(String delimiter)
Returns a new string by joining together, in iteration order, the
string representation of each element in this collection separated by the
specified
delimiter. |
String |
join(String delimiter,
String prefix,
String suffix)
Returns a new string by joining together, in iteration order, the
string representation of each element in this collection separated by the
specified
delimiter and with the specified prefix and
suffix. |
boolean |
remove(Object o)
This operation is not supported.
|
boolean |
removeAll(Collection<?> c)
This operation is not supported.
|
boolean |
retainAll(Collection<?> c)
This operation is not supported.
|
protected int |
sizeDigits()
Returns the number of digits this collection's size has.
|
Object[] |
toArray()
Not implemented in this release.
|
<T> T[] |
toArray(T[] a)
Not implemented in this release.
|
String |
toString()
Returns the string representation of this collection as defined by the
ToStringObject.formatToString(StringBuilder, int) method. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, addAll, iteratorpublic final boolean contains(Object first, Object... more)
true if this collection contains all of the specified
elements.contains in interface BaseCollection<E>first - the first element to check for presence in this setmore - the additional elements to check for presence in this settrue if this collection contains all of the specified
elementsCollection.contains(Object)public final boolean containsAll(Collection<?> c)
true if this collection contains all of the elements in the
specified collection.
This method does not throw a ClassCastException.
containsAll in interface Collection<E>c - a collection whose elements are to be checkedtrue if this collection contains all of the elements in the
specified collectionCollection.contains(Object)public void formatToString(StringBuilder toString, int level)
toString builder at the specified
indentation level a string representation of this collection.
The string representation may contain:
formatToString in interface br.com.objectos.core.object.ToStringObjecttoString - the builder of a toString methodlevel - the indentation level.public final E getOnly()
getOnly in interface BaseCollection<E>IllegalStateException - if the collection is empty or if the collection contains more than
one elementpublic final boolean isEmpty()
true if this collection contains no elements.isEmpty in interface Collection<E>true if this collection contains no elementspublic String join()
The string representation of each element is obtained by invoking its
Object.toString() method.
public String join(String delimiter)
delimiter.
The string representation of each element is obtained by invoking its
Object.toString() method.
public String join(String delimiter, String prefix, String suffix)
delimiter and with the specified prefix and
suffix.public final boolean remove(Object o)
This method performs no operation other than throw an
UnsupportedOperationException.
remove in interface BaseCollection<E>remove in interface Collection<E>o - ignored (this operation is not supported)UnsupportedOperationException - alwayspublic final boolean removeAll(Collection<?> c)
This method performs no operation other than throw an
UnsupportedOperationException.
removeAll in interface BaseCollection<E>removeAll in interface Collection<E>c - ignored (this operation is not supported)UnsupportedOperationException - alwayspublic final boolean retainAll(Collection<?> c)
This method performs no operation other than throw an
UnsupportedOperationException.
retainAll in interface BaseCollection<E>retainAll in interface Collection<E>c - ignored (this operation is not supported)UnsupportedOperationException - alwayspublic Object[] toArray()
toArray in interface Collection<E>UnsupportedOperationException - this method may be implemented in a future releasepublic <T> T[] toArray(T[] a)
toArray in interface Collection<E>a - ignored (this operation in not yet implemented)UnsupportedOperationException - this method may be implemented in a future releasepublic final String toString()
ToStringObject.formatToString(StringBuilder, int) method.protected E getOnlyImpl()
getOnly() when the size is
size == 1.protected final String indexName(int index, int length)
Auxiliary method for formatToString(StringBuilder, int)
implementation.
Examples:
indexName(1, 3); // returns "001"
indexName(37, 3); // returns "037"
indexName(912, 3); // returns "912"
index - the index value to formatlength - the length of the result stringprotected final int sizeDigits()
Auxiliary method for formatToString(StringBuilder, int)
implementation.
Copyright © 2021–2022 Objectos Software LTDA. All rights reserved.