Parcourir la source

Add notes regarding moves to com.hgames.rhogue

smelc il y a 7 ans
Parent
commit
d40e37fae0

+ 1 - 1
squidlib-util/src/main/java/squidpony/IColorCenter.java

@@ -35,7 +35,7 @@ import squidpony.squidmath.RNG;
  * @param <T>
  *            The concrete type of colors
  */
-// FIXME CH Move me to com.hgames.rhogue.color
+/* I cannot be moved to com.hgames.rhogue until IColoredString is moved */
 public interface IColorCenter<T> {
 
 	/**

+ 12 - 8
squidlib-util/src/main/java/squidpony/panel/IColoredString.java

@@ -16,6 +16,10 @@ import java.util.NoSuchElementException;
  * @param <T>
  *            The type of colors;
  */
+/*
+ * I cannot be moved to com.hgames.rhogue until I depend on IFilter, which I
+ * didn't wrote
+ */
 public interface IColoredString<T> extends Iterable<IColoredString.Bucket<T>> {
 
 	/**
@@ -188,7 +192,7 @@ public interface IColoredString<T> extends Iterable<IColoredString.Bucket<T>> {
 	 * @param <T>
 	 *            The type of colors
 	 */
-	class Impl<T> implements IColoredString<T> {
+	public final class Impl<T> implements IColoredString<T> {
 
 		protected final LinkedList<Bucket<T>> fragments;
 
@@ -786,7 +790,7 @@ public interface IColoredString<T> extends Iterable<IColoredString.Bucket<T>> {
 	 * @param <T>
 	 *            The type of colors;
 	 */
-	class Bucket<T> {
+	final class Bucket<T> {
 
 		protected final String text;
 		protected final/* @Nullable */T color;
@@ -797,16 +801,16 @@ public interface IColoredString<T> extends Iterable<IColoredString.Bucket<T>> {
 		}
 
 		/**
-		 * @param text
-		 * @return An instance whose text is {@code this.text + text}. Color is
+		 * @param toadd
+		 * @return An instance whose text is {@code this.text + toadd}. Color is
 		 *         unchanged.
 		 */
-		public Bucket<T> append(String text) {
-			if (text == null || text.isEmpty())
+		public Bucket<T> append(String toadd) {
+			if (toadd == null || toadd.isEmpty())
 				/* Let's save an allocation */
 				return this;
 			else
-				return new Bucket<>(this.text + text, color);
+				return new Bucket<T>(this.text + toadd, color);
 		}
 
 		public Bucket<T> setLength(int l) {
@@ -814,7 +818,7 @@ public interface IColoredString<T> extends Iterable<IColoredString.Bucket<T>> {
 			if (here <= l)
 				return this;
 			else
-				return new Bucket<>(text.substring(0, l), color);
+				return new Bucket<T>(text.substring(0, l), color);
 		}
 
 		public Bucket<T> setColor(T t) {