*
* The MIT License (MIT)
*
- * Copyright (C) 2016 Kevin Lamonte
+ * Copyright (C) 2017 Kevin Lamonte
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
reset();
}
+ /**
+ * Public constructor makes a copy from another instance.
+ *
+ * @param that another CellAttributes instance
+ * @see #reset()
+ */
+ public CellAttributes(final CellAttributes that) {
+ setTo(that);
+ }
+
/**
* Comparison check. All fields must match to return true.
*
}
CellAttributes that = (CellAttributes) rhs;
- return ((bold == that.bold)
- && (blink == that.blink)
+ return ((foreColor == that.foreColor)
+ && (backColor == that.backColor)
+ && (bold == that.bold)
&& (reverse == that.reverse)
&& (underline == that.underline)
- && (protect == that.protect)
- && (foreColor == that.foreColor)
- && (backColor == that.backColor));
+ && (blink == that.blink)
+ && (protect == that.protect));
}
/**
*/
@Override
public String toString() {
- if (bold) {
- return String.format("bold %s on %s",
- foreColor, backColor);
- } else {
- return String.format("%s on %s", foreColor, backColor);
- }
+ return String.format("%s%s%s on %s", (bold == true ? "bold " : ""),
+ (blink == true ? "blink " : ""), foreColor, backColor);
}
}