public class SwiftTreeBlock extends SwiftBlock4
tags
blockType, id, input, output, unparsedTexts
Constructor and Description |
---|
SwiftTreeBlock(SwiftTreeBlockSequence s)
Default and unique constructor, it must receive the main sequence
and performs a preorder traverse of the tree filling the linear
tag list in the super class SwiftBlock4
|
Modifier and Type | Method and Description |
---|---|
SwiftTreeBlockTag |
findByTagNameIndex(java.lang.String tagName,
int index)
Searches tags in all sequences for the one with the given tag index.
|
SwiftTreeBlockSequence |
getMainSequence() |
SwiftTreeBlockSequence |
getSequence(java.lang.String name)
Returns the first sequence with the given name or
null if not found |
int |
getSequenceCount(java.lang.String name)
Returns the amount of sequences with the given name in the block.
|
java.util.List<SwiftTreeBlockSequence> |
getSequences()
Returns a list of all the sequences in the block.
|
java.util.List<SwiftTreeBlockSequence> |
getSequences(java.lang.String name)
Returns a list of the occurrences of sequences with the given name performing a
full recursion of all sequences and subsequences levels.
|
Tag |
getTag(java.lang.String sequenceName,
java.lang.String tagName)
Returns the first occurrence of a tag with the given tag name in
all sequences with the given sequence name.
|
java.util.List<Tag> |
getTags(java.lang.String sequenceName,
java.lang.String tagName)
Returns the list of occurrences of a tag with the given tag name in
all sequences with the given sequence name.
|
void |
setMainSequence(SwiftTreeBlockSequence mainSequence) |
getName, getNumber, setBlockName, setBlockNumber
add, addTag, addTags, append, containsAllOf, containsAnyOf, containsField, containsTag, containsTag, containsTag, countAll, countByName, countTagsStarsWith, equals, filterByName, filterByNameOrdered, getField, getFieldByName, getFieldByName, getFieldByName, getFieldByNumber, getFieldByNumber, getFieldsByName, getFieldsByNumber, getOptionalList, getOptionalList, getOptionalLists, getSubBlock, getSubBlock, getSubBlock, getSubBlock, getSubBlockAfterFirst, getSubBlockAfterLast, getSubBlockBeforeFirst, getSubBlockBeforeLast, getSubBlockByIndex, getSubBlockDelimitedWithOptionalTail, getSubBlocks, getSubBlocks, getSubBlocks, getSubBlocks, getSubBlocks, getSubBlocks, getSubBlocksDelimitedWithOptionalTail, getTag, getTagByName, getTagByNumber, getTagIndex, getTagMap, getTags, getTagsByContent, getTagsByName, getTagsByNumber, getTagsByValue, getTagValue, getTagValues, hashCode, indexOfAnyFirst, indexOfAnyFirstAfterIndex, indexOfAnyLast, indexOfAnyLastAfterIndex, indexOfFirst, indexOfLast, isEmpty, removeAfterFirst, removeAfterFirstStartsWith, removeAll, removeSubBlock, removeTag, removeUntilFirst, setTags, setTags, size, splitByTagName, sublist, tagIterator, tagNamesList, toJson, toString, trimAfterFirst, visit
getBlockType, getId, getUnparsedTexts, getUnparsedTextsSize, isTagBlock, setBlockType, setId, setInput, setOutput, setUnparsedTexts, unparsedTextAddText, unparsedTextAddText, unparsedTextGetAsMessage, unparsedTextGetText, unparsedTextIsMessage, unparsedTextVerify
public SwiftTreeBlock(SwiftTreeBlockSequence s)
s
- main sequence of the complete block tree with sequences and tags
FIXME ver como mejorar esto, si modifican luego la estructura del arbol la lista de tags queda mal
si no se puede mejorar entonces que esto no herede de SwiftBlock4 o bienque sobreescriba
todos los metodos de SwiftBlock de forma tal que los tags se obtengan de la estructura del
arbol recorriendolo en el momentopublic SwiftTreeBlockTag findByTagNameIndex(java.lang.String tagName, int index)
index
- public SwiftTreeBlockSequence getMainSequence()
public SwiftTreeBlockSequence getSequence(java.lang.String name)
null
if not foundgetSequences(String)
public int getSequenceCount(java.lang.String name)
name
- name of the sequence to countpublic java.util.List<SwiftTreeBlockSequence> getSequences()
getSequences(String)
public java.util.List<SwiftTreeBlockSequence> getSequences(java.lang.String name)
null
should be use
for the name parameter.name
- name of the sequences to find or null
to get all block sequencespublic Tag getTag(java.lang.String sequenceName, java.lang.String tagName)
sequenceName
- name of the sequences in witch to search for the tagtagName
- name of the tag to findnull
if non tags or sequences for the given names were foundpublic java.util.List<Tag> getTags(java.lang.String sequenceName, java.lang.String tagName)
sequenceName
- name of the sequences in witch to search for the tagstagName
- name of the tags to findpublic void setMainSequence(SwiftTreeBlockSequence mainSequence)
mainSequence
- the mainSequence to set