public class Word
extends java.lang.Object
Constructor and Description |
---|
Word(CellAttributes defaultColor,
Highlighter highlighter)
Construct a word with an empty string.
|
Word(int ch,
CellAttributes defaultColor,
Highlighter highlighter)
Construct a word with one character.
|
Modifier and Type | Method and Description |
---|---|
Word |
addChar(int ch)
Add a character to this word.
|
void |
applyHighlight()
Perform highlighting.
|
CellAttributes |
getColor()
Get the color used to display this word on screen.
|
int |
getDisplayLength()
Get the on-screen display length.
|
java.lang.String |
getText()
Get the text to display.
|
boolean |
isWhitespace()
See if this is a whitespace word.
|
void |
setColor(CellAttributes color)
Set the color used to display this word on screen.
|
public Word(int ch, CellAttributes defaultColor, Highlighter highlighter)
ch
- the first character of the worddefaultColor
- the color for unhighlighted texthighlighter
- the highlighter to usepublic Word(CellAttributes defaultColor, Highlighter highlighter)
defaultColor
- the color for unhighlighted texthighlighter
- the highlighter to usepublic CellAttributes getColor()
public void setColor(CellAttributes color)
color
- the colorpublic java.lang.String getText()
public int getDisplayLength()
public boolean isWhitespace()
public void applyHighlight()
public Word addChar(int ch)
ch
- the new character to addCopyright © 2019 Kevin Lamonte. Licensed MIT.