summaryrefslogtreecommitdiff
path: root/src/main/java/bjc/esodata/PushdownMap.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/bjc/esodata/PushdownMap.java')
-rw-r--r--src/main/java/bjc/esodata/PushdownMap.java30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/main/java/bjc/esodata/PushdownMap.java b/src/main/java/bjc/esodata/PushdownMap.java
index 5db5f05..54ae939 100644
--- a/src/main/java/bjc/esodata/PushdownMap.java
+++ b/src/main/java/bjc/esodata/PushdownMap.java
@@ -17,10 +17,10 @@ import bjc.funcdata.IMap;
* @author EVE
*
* @param <KeyType>
- * The key of the map.
+ * The key of the map.
*
* @param <ValueType>
- * The values in the map.
+ * The values in the map.
*/
public class PushdownMap<KeyType, ValueType> implements IMap<KeyType, ValueType> {
/* Our backing storage. */
@@ -84,16 +84,15 @@ public class PushdownMap<KeyType, ValueType> implements IMap<KeyType, ValueType>
@Override
public <V2> IMap<KeyType, V2> transform(final Function<ValueType, V2> transformer) {
/*
- * @NOTE Can and should we support this? More to the point,
- * maybe this should be a map sub-type that does what it needs
- * to?
+ * @NOTE Can and should we support this? More to the point, maybe this should be
+ * a map sub-type that does what it needs to?
*/
throw new UnsupportedOperationException("Cannot transform pushdown maps.");
}
@Override
public ValueType put(final KeyType key, final ValueType val) {
- if(backing.containsKey(key)) {
+ if (backing.containsKey(key)) {
final Stack<ValueType> stk = backing.get(key);
final ValueType vl = stk.top();
@@ -114,7 +113,7 @@ public class PushdownMap<KeyType, ValueType> implements IMap<KeyType, ValueType>
public ValueType remove(final KeyType key) {
final Stack<ValueType> stk = backing.get(key);
- if(stk.size() > 1) {
+ if (stk.size() > 1) {
return stk.pop();
}
@@ -138,15 +137,20 @@ public class PushdownMap<KeyType, ValueType> implements IMap<KeyType, ValueType>
@Override
public boolean equals(final Object obj) {
- if(this == obj) return true;
- if(obj == null) return false;
- if(!(obj instanceof PushdownMap<?, ?>)) return false;
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof PushdownMap<?, ?>))
+ return false;
final 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;
}