diff options
| author | bjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu> | 2017-04-07 10:51:31 -0400 |
|---|---|---|
| committer | bjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu> | 2017-04-07 10:51:31 -0400 |
| commit | 63d88eb8db1f7a6d5924ec2a8b7f462373d5ac9a (patch) | |
| tree | 4a7c67b23c8e1ecb1b2f992e5dbaf3ebb48dcf6b /BJC-Utils2/src/main/java/bjc/utils/esodata/PushdownMap.java | |
| parent | 848dc739becfa41193aff9a07c918aed91e5ef79 (diff) | |
Cleanup
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/esodata/PushdownMap.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/esodata/PushdownMap.java | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/esodata/PushdownMap.java b/BJC-Utils2/src/main/java/bjc/utils/esodata/PushdownMap.java index 1e8d2d3..bf72f29 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/esodata/PushdownMap.java +++ b/BJC-Utils2/src/main/java/bjc/utils/esodata/PushdownMap.java @@ -85,7 +85,7 @@ public class PushdownMap<KeyType, ValueType> implements IMap<KeyType, ValueType> @Override public ValueType put(KeyType key, ValueType val) { - if(backing.containsKey(key)) { + if (backing.containsKey(key)) { Stack<ValueType> stk = backing.get(key); ValueType vl = stk.top(); @@ -106,7 +106,7 @@ public class PushdownMap<KeyType, ValueType> implements IMap<KeyType, ValueType> public ValueType remove(KeyType key) { Stack<ValueType> stk = backing.get(key); - if(stk.size() > 1) { + if (stk.size() > 1) { return stk.pop(); } else { return backing.remove(key).top(); @@ -130,27 +130,26 @@ public class PushdownMap<KeyType, ValueType> implements IMap<KeyType, ValueType> @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 PushdownMap<?, ?>)) + return false; PushdownMap<?, ?> other = (PushdownMap<?, ?>) obj; - if(backing == null) { - if(other.backing != null) return false; - } else if(!backing.equals(other.backing)) return false; + if (backing == null) { + if (other.backing != null) + return false; + } else if (!backing.equals(other.backing)) + return false; return true; } @Override public String toString() { - StringBuilder builder = new StringBuilder(); - - builder.append("PushdownMap [backing="); - builder.append(backing); - builder.append("]"); - - return builder.toString(); + return String.format("PushdownMap [backing=%s]", backing); } } |
