|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<E>
org.knowceans.sandbox.ListPrinter<E>
public class ListPrinter<E>
Convienience class to print lists. Should also work with other collections. Users can set the public fields entry* and list* to control printing behaviour. Further, a simple line breaking mechanism is implemented.
| Field Summary | |
|---|---|
java.lang.String |
entryEnd
|
java.lang.String |
entrySeparator
|
java.lang.String |
entryStart
|
java.lang.String |
listEnd
|
java.lang.String |
listStart
|
| Constructor Summary | |
|---|---|
ListPrinter()
empty printer (backed by a Vector). |
|
ListPrinter(java.util.Collection<E> c)
printer for Collection. |
|
ListPrinter(int linewidth)
empty printer (backed by a Vector) with an approximate line width. |
|
ListPrinter(int linewidth,
java.util.Collection<E> c)
printer for Collection with an approximate line width. |
|
ListPrinter(ListPrinter<? extends E> lp)
create an empty ListPrinter object from the configuration of an existing one. |
|
ListPrinter(ListPrinter lp,
java.util.Collection<E> c)
create ListPrinter object for the Collection from the configuration of an existing ListPrinter. |
|
| Method Summary | |
|---|---|
void |
set(java.util.Collection<E> c)
resets the printer content, but keeps the configuration. |
java.lang.String |
toString()
worker method to print out the list. |
| Methods inherited from class java.util.Vector |
|---|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
iterator, listIterator, listIterator |
| Field Detail |
|---|
public java.lang.String entryStart
public java.lang.String entryEnd
public java.lang.String entrySeparator
public java.lang.String listStart
public java.lang.String listEnd
| Constructor Detail |
|---|
public ListPrinter()
public ListPrinter(java.util.Collection<E> c)
c - public ListPrinter(int linewidth)
linewidth - public ListPrinter(ListPrinter<? extends E> lp)
lp -
public ListPrinter(ListPrinter lp,
java.util.Collection<E> c)
lp -
public ListPrinter(int linewidth,
java.util.Collection<E> c)
linewidth - c - | Method Detail |
|---|
public void set(java.util.Collection<E> c)
c - public java.lang.String toString()
toString in class java.util.Vector<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||