*
* The MIT License (MIT)
*
- * Copyright (C) 2017 Kevin Lamonte
+ * Copyright (C) 2019 Kevin Lamonte
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*/
public class Line {
+ // ------------------------------------------------------------------------
+ // Variables --------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
/**
* The list of words.
*/
*/
private StringBuilder rawText;
+ // ------------------------------------------------------------------------
+ // Constructors -----------------------------------------------------------
+ // ------------------------------------------------------------------------
+
+ /**
+ * Construct a new Line from an existing text string, and highlight
+ * certain strings.
+ *
+ * @param str the text string
+ * @param defaultColor the color for unhighlighted text
+ * @param highlighter the highlighter to use
+ */
+ public Line(final String str, final CellAttributes defaultColor,
+ final Highlighter highlighter) {
+
+ this.defaultColor = defaultColor;
+ this.highlighter = highlighter;
+ this.rawText = new StringBuilder(str);
+
+ scanLine();
+ }
+
+ /**
+ * Construct a new Line from an existing text string.
+ *
+ * @param str the text string
+ * @param defaultColor the color for unhighlighted text
+ */
+ public Line(final String str, final CellAttributes defaultColor) {
+ this(str, defaultColor, null);
+ }
+
+ // ------------------------------------------------------------------------
+ // Line -------------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
/**
* Get a (shallow) copy of the words in this line.
*
}
}
- /**
- * Construct a new Line from an existing text string, and highlight
- * certain strings.
- *
- * @param str the text string
- * @param defaultColor the color for unhighlighted text
- * @param highlighter the highlighter to use
- */
- public Line(final String str, final CellAttributes defaultColor,
- final Highlighter highlighter) {
-
- this.defaultColor = defaultColor;
- this.highlighter = highlighter;
- this.rawText = new StringBuilder(str);
-
- scanLine();
- }
-
- /**
- * Construct a new Line from an existing text string.
- *
- * @param str the text string
- * @param defaultColor the color for unhighlighted text
- */
- public Line(final String str, final CellAttributes defaultColor) {
- this(str, defaultColor, null);
- }
-
/**
* Decrement the cursor by one. If at the first column, do nothing.
*