fix javadoc header
[fanfix.git] / src / jexer / bits / CellAttributes.java
index a3d912cc433805c2a771af156732bc06fe999d7d..0ea0d88579929249825a8d9b13cd21c31358924a 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Jexer - Java Text User Interface
  *
  * License: LGPLv3 or later
@@ -45,7 +45,7 @@ public class CellAttributes {
      *
      * @return bold value
      */
-    public final boolean getBold() {
+    public final boolean isBold() {
         return bold;
     }
 
@@ -68,7 +68,7 @@ public class CellAttributes {
      *
      * @return blink value
      */
-    public final boolean getBlink() {
+    public final boolean isBlink() {
         return blink;
     }
 
@@ -91,7 +91,7 @@ public class CellAttributes {
      *
      * @return reverse value
      */
-    public final boolean getReverse() {
+    public final boolean isReverse() {
         return reverse;
     }
 
@@ -114,7 +114,7 @@ public class CellAttributes {
      *
      * @return underline value
      */
-    public final boolean getUnderline() {
+    public final boolean isUnderline() {
         return underline;
     }
 
@@ -137,7 +137,7 @@ public class CellAttributes {
      *
      * @return protect value
      */
-    public final boolean getProtect() {
+    public final boolean isProtect() {
         return protect;
     }
 
@@ -242,12 +242,32 @@ public class CellAttributes {
             && (backColor == that.backColor));
     }
 
+    /**
+     * 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) + (bold ? 1 : 0);
+        hash = (B * hash) + (blink ? 1 : 0);
+        hash = (B * hash) + (underline ? 1 : 0);
+        hash = (B * hash) + (reverse ? 1 : 0);
+        hash = (B * hash) + (protect ? 1 : 0);
+        hash = (B * hash) + foreColor.hashCode();
+        hash = (B * hash) + backColor.hashCode();
+        return hash;
+    }
+
     /**
      * Set my field values to that's field.
      *
      * @param rhs another CellAttributes instance
      */
-    public void setTo(Object rhs) {
+    public void setTo(final Object rhs) {
         CellAttributes that = (CellAttributes) rhs;
 
         this.bold      = that.bold;