X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbits%2FCell.java;h=e75680864fb60dc27910a845b27db6c5d7bfb2d1;hb=91c9a8376f979d2b3df43f14519a30a183d332c5;hp=3c0eb14a04a4c0969b4a778b6d54050379a2c89d;hpb=2b9c27db318b916730aa04f2b41bd3bff795a5dc;p=fanfix.git diff --git a/src/jexer/bits/Cell.java b/src/jexer/bits/Cell.java index 3c0eb14..e756808 100644 --- a/src/jexer/bits/Cell.java +++ b/src/jexer/bits/Cell.java @@ -77,11 +77,11 @@ public final class Cell extends CellAttributes { 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; @@ -107,6 +107,21 @@ public final class Cell extends CellAttributes { && (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. * @@ -163,6 +178,6 @@ public final class Cell extends CellAttributes { @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); } }