public class Document extends Block implements MutableDataHolder
lineSegmentsEMPTY_SEGMENTS, SPLICE| Constructor and Description |
|---|
Document(DataHolder options,
BasedSequence chars) |
| Modifier and Type | Method and Description |
|---|---|
MutableDataHolder |
clear()
clear all options out of the data set
|
boolean |
contains(DataKey key) |
<T> T |
get(DataKey<T> key)
Get the given key, if it does not exist then use the key's factory to create a new value and put it into the collection
so that the following get of the same key will find a value
|
Map<DataKey,Object> |
getAll() |
int |
getLineCount() |
int |
getLineNumber(int offset) |
<T> T |
getOrCompute(DataKey<T> key,
DataValueFactory<T> factory)
Will return the value previously set or generate a new value using the given factory.
|
BasedSequence[] |
getSegments() |
Collection<DataKey> |
keySet() |
<T> MutableDataHolder |
remove(DataKey<T> key)
Remove the stored value for the key, used to force to default or to force recompute
|
<T> MutableDataHolder |
set(DataKey<T> key,
T value)
Store the given value for the key
|
MutableDataHolder |
setAll(DataHolder other)
Copy all values from one data holder to this data holder
|
MutableDataHolder |
setFrom(MutableDataSetter dataSetter)
Store the given value for the key
|
MutableDataHolder |
setIn(MutableDataHolder dataHolder)
Set options in gven mutable data hoer
|
DataHolder |
toImmutable() |
MutableDataHolder |
toMutable() |
getContentChars, getContentChars, getContentLines, getContentLines, getLineChars, getSpanningChars, setContent, setContent, setContent, setContentLine, setContentLinesappendChain, appendChild, astChars, astExtraChars, astString, countAncestorsOfType, countDirectAncestorsOfType, delimitedSegmentSpan, delimitedSegmentSpanChars, deNullify, extractChainTo, extractToFirstInChain, getAncestorOfType, getAstExtra, getBlankLineSibling, getChars, getCharsFromSegments, getChildChars, getChildIterator, getChildOfType, getChildren, getDescendants, getDocument, getEndLineNumber, getEndOffset, getExactChildChars, getFirstChild, getFirstChildAny, getFirstChildAnyNot, getFirstInChain, getLastBlankLineChild, getLastChild, getLastChildAny, getLastChildAnyNot, getLastInChain, getLeadSegment, getLineNumber, getNext, getNextAny, getNextAnyNot, getNodeName, getNodeOfTypeIndex, getNodeOfTypeIndex, getOldestAncestorOfTypeAfter, getPrevious, getPreviousAny, getPreviousAnyNot, getReversedChildIterator, getReversedChildren, getReversedDescendants, getSegmentsForChars, getStartLineNumber, getStartOffset, getTextLength, getTrailSegment, hasChildren, hasOrMoreChildren, insertAfter, insertBefore, insertChainAfter, insertChainBefore, isOrDescendantOfType, moveTrailingBlankLines, prependChild, removeChildren, segmentSpan, segmentSpan, segmentSpanChars, segmentSpanChars, segmentSpanChars, setChars, setCharsFromContent, setCharsFromContentOnly, setCharsFromSegments, spanningChars, takeChildren, toAstString, toSegmentSpan, toString, toStringAttributes, unlinkpublic Document(DataHolder options, BasedSequence chars)
public BasedSequence[] getSegments()
getSegments in class Nodepublic Map<DataKey,Object> getAll()
getAll in interface DataHolderpublic Collection<DataKey> keySet()
keySet in interface DataHolderpublic boolean contains(DataKey key)
contains in interface DataHolderpublic <T> T get(DataKey<T> key)
MutableDataHolderget in interface DataHolderget in interface MutableDataHolderkey - data keypublic MutableDataHolder setIn(MutableDataHolder dataHolder)
MutableDataHoldersetIn in interface MutableDataHoldersetIn in interface MutableDataSetterdataHolder - data holder where to copy options from this data holderpublic int getLineCount()
getLineCount in interface ContentgetLineCount in class ContentNodepublic int getLineNumber(int offset)
public <T> T getOrCompute(DataKey<T> key, DataValueFactory<T> factory)
MutableDataHoldergetOrCompute in interface MutableDataHolderT - data type of the data referred by the keykey - data key identifying the datafactory - data value factory to use if the data referred by the key is not setpublic <T> MutableDataHolder remove(DataKey<T> key)
MutableDataHolderremove in interface MutableDataHolderT - data type of the data referred by the keykey - data key to removepublic <T> MutableDataHolder set(DataKey<T> key, T value)
MutableDataHolderset in interface MutableDataHolderT - data type of the data referred by the keykey - data keyvalue - value to storepublic MutableDataHolder setFrom(MutableDataSetter dataSetter)
MutableDataHoldersetFrom in interface MutableDataHolderdataSetter - data setter which will set valuespublic MutableDataHolder setAll(DataHolder other)
MutableDataHoldersetAll in interface MutableDataHolderother - data holder from which to copy all valuespublic MutableDataHolder toMutable()
toMutable in interface DataHolderpublic DataHolder toImmutable()
toImmutable in interface DataHolderpublic MutableDataHolder clear()
MutableDataHolderclear in interface MutableDataHolderCopyright © 2019. All rights reserved.