Package cz.vutbr.fit.layout.impl
Class DefaultContentLine
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<ContentRect>
-
- cz.vutbr.fit.layout.impl.DefaultContentLine
-
- All Implemented Interfaces:
ContentLine,Serializable,Cloneable,Iterable<ContentRect>,Collection<ContentRect>,List<ContentRect>,RandomAccess
public class DefaultContentLine extends ArrayList<ContentRect> implements ContentLine
A default ContentLine implementation using a simple ArrayList. This is suitable for shorter lines since the area lookup is always sequentional.- Author:
- burgetr
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description DefaultContentLine()DefaultContentLine(int size)DefaultContentLine(Collection<? extends Area> src)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, ContentRect area)booleanadd(ContentRect area)booleanaddAll(int index, Collection<? extends ContentRect> c)booleanaddAll(Collection<? extends ContentRect> c)ContentRectgetAreaAfter(ContentRect area)Finds the area that follows the given area on the line.ContentRectgetAreaBefore(ContentRect area)Finds the area that precedes the given area on the line.-
Methods inherited from class java.util.ArrayList
clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Constructor Detail
-
DefaultContentLine
public DefaultContentLine()
-
DefaultContentLine
public DefaultContentLine(int size)
-
DefaultContentLine
public DefaultContentLine(Collection<? extends Area> src)
-
-
Method Detail
-
getAreaBefore
public ContentRect getAreaBefore(ContentRect area)
Description copied from interface:ContentLineFinds the area that precedes the given area on the line.- Specified by:
getAreaBeforein interfaceContentLine- Parameters:
area- the given area- Returns:
- the preceding area or
nullifareais the first area in the line.
-
getAreaAfter
public ContentRect getAreaAfter(ContentRect area)
Description copied from interface:ContentLineFinds the area that follows the given area on the line.- Specified by:
getAreaAfterin interfaceContentLine- Parameters:
area- the given area- Returns:
- the following area or
nullifareais the last area in the line.
-
add
public boolean add(ContentRect area)
- Specified by:
addin interfaceCollection<ContentRect>- Specified by:
addin interfaceList<ContentRect>- Overrides:
addin classArrayList<ContentRect>
-
add
public void add(int index, ContentRect area)- Specified by:
addin interfaceList<ContentRect>- Overrides:
addin classArrayList<ContentRect>
-
addAll
public boolean addAll(Collection<? extends ContentRect> c)
- Specified by:
addAllin interfaceCollection<ContentRect>- Specified by:
addAllin interfaceList<ContentRect>- Overrides:
addAllin classArrayList<ContentRect>
-
addAll
public boolean addAll(int index, Collection<? extends ContentRect> c)- Specified by:
addAllin interfaceList<ContentRect>- Overrides:
addAllin classArrayList<ContentRect>
-
-