Package com.oorian.html.elements
Class TableRows
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Tr>,Collection<Tr>,List<Tr>,RandomAccess,SequencedCollection<Tr>
A specialized collection for managing HTML table row elements.
This class extends ArrayList to provide type-safe storage and manipulation
of Tr (table row) objects. It serves as a convenient container for managing
collections of table rows, offering all the functionality of an ArrayList while
ensuring type safety for table row operations. This is particularly useful when
programmatically generating table content or managing dynamic table structures.
Features:
- Type-safe collection specifically for
Trobjects - Inherits all ArrayList functionality (add, remove, iterate, etc.)
- Provides convenient storage for groups of table rows
- Useful for programmatic table generation and manipulation
- Simplifies batch operations on multiple rows
- Facilitates table structure management in complex scenarios
Usage:
// Create a collection of table rows
TableRows rows = new TableRows();
// Add rows to the collection
Tr row1 = new Tr();
row1.addElement(new Td("Row 1, Cell 1"));
row1.addElement(new Td("Row 1, Cell 2"));
rows.add(row1);
Tr row2 = new Tr();
row2.addElement(new Td("Row 2, Cell 1"));
row2.addElement(new Td("Row 2, Cell 2"));
rows.add(row2);
// Iterate over rows
for (Tr row : rows) {
row.setBackgroundColor("#f9f9f9");
}
// Use in table body construction
Tbody tbody = new Tbody();
for (Tr row : rows) {
tbody.addElement(row);
}
- Since:
- 2007
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
Constructor Details
-
TableRows
public TableRows()
-