public class PrintableArrayList extends ArrayList implements Printable
modCount
NO_SUCH_PAGE, PAGE_EXISTS
Constructor and Description |
---|
PrintableArrayList()
Constructs an empty list with an initial capacity of ten.
|
PrintableArrayList(Collection c)
Constructs a list containing the elements of the specified collection,
in the order they are returned by the collection's iterator.
|
PrintableArrayList(int initialCapacity)
Constructs an empty list with the specified initial capacity.
|
Modifier and Type | Method and Description |
---|---|
ArrayList |
getDesc()
Get the description ArrayList.
|
Font |
getFont()
Get the printing font.
|
String |
getPageHeader()
Get the page header.
|
int |
print(Graphics g,
PageFormat pf,
int pageIndex)
This method implements the Printable interface.
|
void |
setDesc(ArrayList al)
Set the description for the array.
|
void |
setFont(Font font)
Set the printing font.
|
void |
setPageHeader(String header)
Set the printing page header for the array.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public PrintableArrayList()
public PrintableArrayList(Collection c)
c
- the collection whose elements are to be placed into this list.public PrintableArrayList(int initialCapacity)
initialCapacity
- the initial capacity of the list.public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException
print
in interface Printable
g
- the graphics context.pf
- the PageFormat for printing.pageIndex
- the page index starting from 0.PrinterException
public void setPageHeader(String header)
header
- the header text.public String getPageHeader()
public void setDesc(ArrayList al)
al
- the description array. The toString() for each item will be
called for printing the description area.public ArrayList getDesc()
public void setFont(Font font)
font
- the font for printing.public Font getFont()
Copyright © 2003, 2023, Oracle and/or its affiliates.