summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/esodata/DoubleTape.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu>2017-04-07 10:51:31 -0400
committerbjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu>2017-04-07 10:51:31 -0400
commit63d88eb8db1f7a6d5924ec2a8b7f462373d5ac9a (patch)
tree4a7c67b23c8e1ecb1b2f992e5dbaf3ebb48dcf6b /BJC-Utils2/src/main/java/bjc/utils/esodata/DoubleTape.java
parent848dc739becfa41193aff9a07c918aed91e5ef79 (diff)
Cleanup
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/esodata/DoubleTape.java')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/esodata/DoubleTape.java47
1 files changed, 23 insertions, 24 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/esodata/DoubleTape.java b/BJC-Utils2/src/main/java/bjc/utils/esodata/DoubleTape.java
index ec24431..8df7aa9 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/esodata/DoubleTape.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/esodata/DoubleTape.java
@@ -159,7 +159,7 @@ public class DoubleTape<T> implements Tape<T> {
public boolean left(int amt) {
boolean succ = front.left(amt);
- if(succ) {
+ if (succ) {
back.right(amt);
}
@@ -192,7 +192,7 @@ public class DoubleTape<T> implements Tape<T> {
public boolean right(int amt) {
boolean succ = front.right(amt);
- if(succ) {
+ if (succ) {
back.left(amt);
}
@@ -229,33 +229,32 @@ public class DoubleTape<T> implements Tape<T> {
@Override
public boolean equals(Object obj) {
- if(this == obj) return true;
- if(obj == null) return false;
- if(getClass() != obj.getClass()) return false;
-
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof DoubleTape<?>))
+ return false;
+
DoubleTape<?> other = (DoubleTape<?>) obj;
-
- if(back == null) {
- if(other.back != null) return false;
- } else if(!back.equals(other.back)) return false;
-
- if(front == null) {
- if(other.front != null) return false;
- } else if(!front.equals(other.front)) return false;
-
+
+ if (back == null) {
+ if (other.back != null)
+ return false;
+ } else if (!back.equals(other.back))
+ return false;
+
+ if (front == null) {
+ if (other.front != null)
+ return false;
+ } else if (!front.equals(other.front))
+ return false;
+
return true;
}
@Override
public String toString() {
- StringBuilder builder = new StringBuilder();
-
- builder.append("DoubleTape [front=");
- builder.append(front);
- builder.append(", back=");
- builder.append(back);
- builder.append("]");
-
- return builder.toString();
+ return String.format("DoubleTape [front=%s, back=%s]", front, back);
}
}