public class WrapImpl extends Wrap
Modifier and Type | Class and Description |
---|---|
static class |
WrapImpl.Type |
Constructor and Description |
---|
WrapImpl(WrapType type,
boolean wrapFirstElement) |
Modifier and Type | Method and Description |
---|---|
LeafBlockWrapper |
getChopStartBlock() |
boolean |
getIgnoreParentWraps() |
WrapImpl |
getParent()
Allows to check if single wrap is
registered for the current wrap and return
it in case of success. |
WrapImpl.Type |
getType() |
int |
getWrapOffset() |
void |
ignoreParentWrap(WrapImpl wrap,
LeafBlockWrapper currentBlock)
Allows to mark given wrap as
'ignored' for the given block. |
void |
ignoreParentWraps()
Allows to instruct current wrap to ignore all parent wraps, i.e.
|
boolean |
isActive() |
boolean |
isChildOf(WrapImpl wrap,
LeafBlockWrapper leaf) |
boolean |
isChildOf(WrapImpl wrap,
LeafBlockWrapper leaf,
FormatterIterationMonitor<java.lang.Boolean> iterationMonitor) |
boolean |
isWrapFirstElement()
Allows to check if current wrap object is configured to wrap first element.
|
void |
reset()
Resets the following state of the current wrap object:
'
firstEntry ' property value is set to null ;
'firstPosition ' property value is set to '-1' ;
'isActive ' property value is set to 'false' ;
|
void |
saveChopBlock(LeafBlockWrapper current) |
void |
setActive()
Performs the following changes at wrap object state:
'
firstEntry ' property value is dropped (set to null )
'isActive ' property value is set (to true )
|
void |
setWrapOffset(int startOffset)
Applies given value to the '
firstPosition ' property value if it's value is undefined at the moment
(has negative value). |
java.lang.String |
toString() |
createChildWrap, createWrap, createWrap
public WrapImpl(WrapType type, boolean wrapFirstElement)
public boolean isChildOf(WrapImpl wrap, LeafBlockWrapper leaf)
public boolean isChildOf(WrapImpl wrap, LeafBlockWrapper leaf, FormatterIterationMonitor<java.lang.Boolean> iterationMonitor)
public void reset()
firstEntry
' property value is set to null
;firstPosition
' property value is set to '-1'
;isActive
' property value is set to 'false'
;public WrapImpl getParent()
registered
for the current wrap and return
it in case of success.null
if no wraps or more than one wrap is registered as a parent for the current wrappublic final boolean getIgnoreParentWraps()
public void ignoreParentWrap(WrapImpl wrap, LeafBlockWrapper currentBlock)
'ignored'
for the given block. I.e. 'false' will be returned
for subsequent calls to isChildOf(WrapImpl, LeafBlockWrapper)
with the same arguments.wrap
- target wrapcurrentBlock
- target block for which given wrap should be ignoredpublic LeafBlockWrapper getChopStartBlock()
public void setActive()
firstEntry
' property value is dropped (set to null
)isActive
' property value is set (to true
)public void setWrapOffset(int startOffset)
firstPosition
' property value if it's value is undefined at the moment
(has negative value).startOffset
- new 'firstPosition
' property value to use if current value is undefined (negative)public int getWrapOffset()
firstPosition
' property value defined previously via setWrapOffset(int)
if any;
'-1'
otherwisepublic final WrapImpl.Type getType()
public final boolean isWrapFirstElement()
constructor
during object initialization and can't be changed later.'wrapFirstElement'
property valuepublic void saveChopBlock(LeafBlockWrapper current)
public final boolean isActive()
public java.lang.String toString()
toString
in class java.lang.Object
public void ignoreParentWraps()
isChildOf(WrapImpl, LeafBlockWrapper)
return 'false'
after invocation of this method.ignoreParentWraps
in class Wrap
Wrap.createChildWrap(Wrap, WrapType, boolean)