public class CodeBlock
extends java.lang.Object
| 修飾子とタイプ | クラスと説明 |
|---|---|
static class |
CodeBlock.BlockType
All JAVA types of code blocks
|
static class |
CodeBlock.Modifier
Modifiers (for class attributes and functions)
|
| 修飾子とタイプ | フィールドと説明 |
|---|---|
java.lang.String |
code
Source code
|
int |
end
Indicate the end position of block in the source code
|
boolean |
hasParent
Indicate if the code block is nested or not.
|
boolean |
injected
Indicate if the code block is injected by programming code.
|
int |
innerOffset
Inner offset (from start of parent)
|
CodeBlock.Modifier |
modifier
define modifier type (public, private, protected)
|
java.lang.String |
name
Black name for Class or function or Annotation
|
int |
offset
Start/End offset (from start of file)
|
CodeBlock.BlockType |
parentType
Type of the parent block
|
java.lang.String |
returnType
Type name of the object returned by the function (optional)
|
int |
start
Indicate the star position of block in the source code
|
SmartArrayList<CodeBlock> |
subBlocks
Sub blocks of code contains by the current block
|
SmartArrayList<CodePosition> |
subIndexes
Sub block position indexes
|
CodeBlock.BlockType |
type
Define type of block
|
java.util.ArrayList<CodeString> |
words
Source code of the block split in words (useful for processing)
|
| コンストラクタと説明 |
|---|
CodeBlock() |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
int |
getEnd()
Return the end position (character index) with offset
|
int |
getStart()
Return the start position (character index) with offset
|
boolean |
hasChildren()
Indicate if the block has children or not
|
static boolean |
isClass(CodeBlock.BlockType blockType)
Indicate if the block is a Class or Anonymous Inner Class
|
boolean |
isComment()
Indicate if the block is a line or block of comment
|
static boolean |
isComment(CodeBlock.BlockType blockType)
Indicate if the block is a line or block of comment
|
boolean |
isFunctionOrClass(CodeBlock.BlockType blockType)
Indicate if the block is a Function or a Class
|
java.lang.String |
toCode()
Generate the source code of the block
|
java.lang.String |
toString()
Return a String version of the object
|
void |
updatePosition(CodeBlock previousBlock)
Update the offset and position of the block from the previous block of the list.
|
java.lang.String |
wordsToString()
Convert all words to a String value (source code)
|
public int start
public int end
public int offset
public int innerOffset
public java.lang.String code
public java.lang.String name
public CodeBlock.BlockType type
public CodeBlock.Modifier modifier
public java.lang.String returnType
public SmartArrayList<CodeBlock> subBlocks
public java.util.ArrayList<CodeString> words
public boolean hasParent
public SmartArrayList<CodePosition> subIndexes
public CodeBlock.BlockType parentType
public boolean injected
public int getStart()
public int getEnd()
public java.lang.String wordsToString()
public void updatePosition(CodeBlock previousBlock)
previousBlock - Previous block of the listpublic boolean isComment()
public boolean isFunctionOrClass(CodeBlock.BlockType blockType)
blockType - Type of blockpublic static boolean isComment(CodeBlock.BlockType blockType)
blockType - Type of blockpublic static boolean isClass(CodeBlock.BlockType blockType)
blockType - Type of blockpublic java.lang.String toString()
toString クラス内 java.lang.Objectpublic boolean hasChildren()
public java.lang.String toCode()