Class FileElement
java.lang.Object
io.github.syst3ms.skriptparser.file.FileElement
- Direct Known Subclasses:
FileSection, VoidElement
Represents any non-blank and not comment-only line in a file. It is important to note that information about comments
is absent from this class, as they are discarded before being passed to the constructor.
IMPORTANT : even though
IMPORTANT : even though
FileSection inherits from this class, they are semantically different ; that is,
FileSection will be treated separately, rather than just being treated as some inheritor with
additional properties.-
Constructor Details
-
FileElement
-
-
Method Details
-
getLineContent
The returnedStringdoes not include the indentation of the line. To have the line content along with indentation, usetoString()- Returns:
- the text content of this line, excluding any indentation.
-
equals
-
getIndentation
public int getIndentation()- Returns:
- how much this line is indented, e.g shifted by either a tab character or 4 spaces.
-
toString
-
getFileName
- Returns:
- the name of the file this line is contained in
-
getLine
public int getLine()Line numbering starts at 1, and blank and comment-only lines are accounted for.- Returns:
- the line in the file where this line is located at.
-