-/**
+/*
* Jexer - Java Text User Interface
*
* License: LGPLv3 or later
public boolean isBlank() {
if ((getForeColor().equals(Color.WHITE))
&& (getBackColor().equals(Color.BLACK))
- && !getBold()
- && !getBlink()
- && !getReverse()
- && !getUnderline()
- && !getProtect()
+ && !isBold()
+ && !isBlink()
+ && !isReverse()
+ && !isUnderline()
+ && !isProtect()
&& (ch == ' ')
) {
return true;
&& (ch == that.ch));
}
+ /**
+ * Hashcode uses all fields in equals().
+ *
+ * @return the hash
+ */
+ @Override
+ public int hashCode() {
+ int A = 13;
+ int B = 23;
+ int hash = A;
+ hash = (B * hash) + super.hashCode();
+ hash = (B * hash) + (int)ch;
+ return hash;
+ }
+
/**
* Set my field values to that's field.
*
@Override
public String toString() {
return String.format("fore: %d back: %d bold: %s blink: %s ch %c",
- getForeColor(), getBackColor(), getBold(), getBlink(), ch);
+ getForeColor(), getBackColor(), isBold(), isBlink(), ch);
}
}