org.apache.fop.layoutmgr
Class KnuthSequence
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.ArrayList
|
+--org.apache.fop.layoutmgr.KnuthSequence
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable
- Direct Known Subclasses:
- BlockKnuthSequence, InlineKnuthSequence
- public abstract class KnuthSequence
- extends java.util.ArrayList
- See Also:
- Serialized Form
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary |
KnuthSequence()
Creates a new and empty list. |
KnuthSequence(java.util.List list)
Creates a new list from an existing list. |
Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
containsAll, remove, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList |
KnuthSequence
public KnuthSequence()
- Creates a new and empty list.
KnuthSequence
public KnuthSequence(java.util.List list)
- Creates a new list from an existing list.
- Parameters:
list
- The list from which to create the new list.
startSequence
public void startSequence()
- Marks the start of the sequence.
endSequence
public abstract KnuthSequence endSequence()
- Finalizes a Knuth sequence.
- Returns:
- a finalized sequence.
canAppendSequence
public abstract boolean canAppendSequence(KnuthSequence sequence)
- Can sequence be appended to this sequence?
- Parameters:
sequence
- The sequence that may be appended.- Returns:
- whether the sequence can be appended to this sequence.
appendSequence
public abstract boolean appendSequence(KnuthSequence sequence,
boolean keepTogether,
BreakElement breakElement)
- Append sequence to this sequence if it can be appended.
- Parameters:
sequence
- The sequence that is to be appended.keepTogether
- Whether the two sequences must be kept together.breakElement
- The BreakElement that may be inserted between the two sequences.- Returns:
- whether the sequence was succesfully appended to this sequence.
appendSequence
public abstract boolean appendSequence(KnuthSequence sequence)
- Append sequence to this sequence if it can be appended.
- Parameters:
sequence
- The sequence that is to be appended.- Returns:
- whether the sequence was succesfully appended to this sequence.
appendSequenceOrClose
public boolean appendSequenceOrClose(KnuthSequence sequence)
- Append sequence to this sequence if it can be appended.
If that is not possible, close this sequence.
- Parameters:
sequence
- The sequence that is to be appended.- Returns:
- whether the sequence was succesfully appended to this sequence.
appendSequenceOrClose
public boolean appendSequenceOrClose(KnuthSequence sequence,
boolean keepTogether,
BreakElement breakElement)
- Append sequence to this sequence if it can be appended.
If that is not possible, close this sequence.
- Parameters:
sequence
- The sequence that is to be appended.keepTogether
- Whether the two sequences must be kept together.breakElement
- The BreakElement that may be inserted between the two sequences.- Returns:
- whether the sequence was succesfully appended to this sequence.
wrapPositions
public void wrapPositions(LayoutManager lm)
- Wrap the Positions of the elements of this sequence in a Position for LayoutManager lm.
- Parameters:
lm
- The LayoutManager for the Positions that will be created.
getLast
public ListElement getLast()
- Returns:
- the last element of this sequence.
removeLast
public ListElement removeLast()
- Remove the last element of this sequence.
- Returns:
- the removed element.
getElement
public ListElement getElement(int index)
- Parameters:
index
- The index of the element to be returned- Returns:
- the element at index index.
isInlineSequence
public abstract boolean isInlineSequence()
- Is this an inline or a block sequence?
- Returns:
- true if this is an inline sequence
Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.