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 void
add(int index, ContentRect area)
boolean
add(ContentRect area)
boolean
addAll(int index, Collection<? extends ContentRect> c)
boolean
addAll(Collection<? extends ContentRect> c)
ContentRect
getAreaAfter(ContentRect area)
Finds the area that follows the given area on the line.ContentRect
getAreaBefore(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:ContentLine
Finds the area that precedes the given area on the line.- Specified by:
getAreaBefore
in interfaceContentLine
- Parameters:
area
- the given area- Returns:
- the preceding area or
null
ifarea
is the first area in the line.
-
getAreaAfter
public ContentRect getAreaAfter(ContentRect area)
Description copied from interface:ContentLine
Finds the area that follows the given area on the line.- Specified by:
getAreaAfter
in interfaceContentLine
- Parameters:
area
- the given area- Returns:
- the following area or
null
ifarea
is the last area in the line.
-
add
public boolean add(ContentRect area)
- Specified by:
add
in interfaceCollection<ContentRect>
- Specified by:
add
in interfaceList<ContentRect>
- Overrides:
add
in classArrayList<ContentRect>
-
add
public void add(int index, ContentRect area)
- Specified by:
add
in interfaceList<ContentRect>
- Overrides:
add
in classArrayList<ContentRect>
-
addAll
public boolean addAll(Collection<? extends ContentRect> c)
- Specified by:
addAll
in interfaceCollection<ContentRect>
- Specified by:
addAll
in interfaceList<ContentRect>
- Overrides:
addAll
in classArrayList<ContentRect>
-
addAll
public boolean addAll(int index, Collection<? extends ContentRect> c)
- Specified by:
addAll
in interfaceList<ContentRect>
- Overrides:
addAll
in classArrayList<ContentRect>
-
-