public class DynamicPartitionedTextFormatter extends Object implements PartitionedTextFormatter<SimpleTextFormatter>
PartitionedTextFormatter
that allows for
modifications on the partitions.Modifier and Type | Field and Description |
---|---|
protected List<SimpleTextFormatter> |
partitions |
Constructor and Description |
---|
DynamicPartitionedTextFormatter()
creates a new partitioned text formatter.
|
DynamicPartitionedTextFormatter(int initialSize)
Creates a new
DynamicPartitionedTextFormatter . |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Collection<SimpleTextFormatter> elements)
Adds the specified elements to the end of this formatter.
|
boolean |
add(SimpleTextFormatter element)
Adds the specified element to the end of this formatter.
|
void |
clear()
Clears all elements from this formatter.
|
boolean |
contains(SimpleTextFormatter element)
Returns true if the specified element is in the formatter.
|
SimpleTextFormatter |
get(int i)
Returns the element at the specified index.
|
ImmutableList<SimpleTextFormatter> |
getAll()
Returns an
ImmutableList of this formatter's elements. |
void |
insert(int i,
Collection<SimpleTextFormatter> elements)
Inserts the specified elements at the specified index within the
formatter.
|
void |
insert(int i,
SimpleTextFormatter element)
Inserts the specified element at the specified index within the
formatter.
|
boolean |
isEmpty()
Returns true if the formatter contains no elements.
|
boolean |
remove(Collection<SimpleTextFormatter> elements)
Removes the specified elements from the formatter.
|
boolean |
remove(SimpleTextFormatter element)
Removes the specified element from the formatter.
|
boolean |
retain(Collection<SimpleTextFormatter> elements)
Removes all elements from the formatter except for these specified
elements.
|
SimpleTextFormatter |
set(int i,
SimpleTextFormatter element)
Replaces the element previously at the specified index with the
specified element.
|
int |
size()
Returns the amount of elements in this formatter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, first, firstAfter, forEach, forEachAfter, format, insert, insert, iterator, remove, remove, retain, retain, toText
applyTo
forEach, spliterator
protected final List<SimpleTextFormatter> partitions
public DynamicPartitionedTextFormatter(int initialSize)
DynamicPartitionedTextFormatter
.initialSize
- The initial size of partitionspublic DynamicPartitionedTextFormatter()
public ImmutableList<SimpleTextFormatter> getAll()
TextFormatter
ImmutableList
of this formatter's elements.getAll
in interface TextFormatter<SimpleTextFormatter>
public SimpleTextFormatter get(int i)
TextFormatter
get
in interface TextFormatter<SimpleTextFormatter>
i
- Index to retrieve frompublic SimpleTextFormatter set(int i, SimpleTextFormatter element)
TextFormatter
set
in interface TextFormatter<SimpleTextFormatter>
i
- Index to replaceelement
- Element to replace withpublic int size()
TextFormatter
size
in interface TextFormatter<SimpleTextFormatter>
public boolean isEmpty()
TextFormatter
isEmpty
in interface TextFormatter<SimpleTextFormatter>
public boolean contains(SimpleTextFormatter element)
TextFormatter
contains
in interface TextFormatter<SimpleTextFormatter>
element
- Element to checkpublic void clear()
TextFormatter
clear
in interface TextFormatter<SimpleTextFormatter>
public boolean add(SimpleTextFormatter element)
TextFormatter
add
in interface TextFormatter<SimpleTextFormatter>
element
- Element to addpublic boolean add(Collection<SimpleTextFormatter> elements)
TextFormatter
add
in interface TextFormatter<SimpleTextFormatter>
elements
- Elements to addpublic void insert(int i, SimpleTextFormatter element)
TextFormatter
insert
in interface TextFormatter<SimpleTextFormatter>
i
- Index to insert atelement
- Element to insertpublic void insert(int i, Collection<SimpleTextFormatter> elements)
TextFormatter
insert
in interface TextFormatter<SimpleTextFormatter>
i
- Index to insert atelements
- Elements to insertpublic boolean remove(SimpleTextFormatter element)
TextFormatter
remove
in interface TextFormatter<SimpleTextFormatter>
element
- Element to removepublic boolean remove(Collection<SimpleTextFormatter> elements)
TextFormatter
remove
in interface TextFormatter<SimpleTextFormatter>
elements
- Elements to removepublic boolean retain(Collection<SimpleTextFormatter> elements)
TextFormatter
retain
in interface TextFormatter<SimpleTextFormatter>
elements
- Elements to retain