biz.ostw.fsi.xml.TerminalPart.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fsi Show documentation
Show all versions of fsi Show documentation
File structure investigation project
package biz.ostw.fsi.xml
import biz.ostw.fsi.Part
/**
* Created by mathter on 28.07.17.
*/
class TerminalPart() extends Part {
private var _start: Int = 0
private var _text: String = null
def this(_text: String) = {
this()
if (_text == null) {
throw new NullPointerException("value of the therminal part can't be null!")
}
this._text = _text
}
override def start(): Int = {
_start
}
override def stop(): Int = {
this._start + this._text.length - 1
}
override def text(): String = {
this._text
}
def text(text: String): Unit = {
this._text = text
}
override def recalc(start: Int): Int = {
this._start = start
this._start + this._text.length
}
}