diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:43:13 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:43:13 -0400 |
| commit | f51f6da7319787348c38b875652b5c0e9f88c8aa (patch) | |
| tree | 943888fc724da2d2dedd89abec99dcbfcc089fd0 /src/main/java/bjc/esodata/PushdownMap.java | |
| parent | 9052ed6da37af23ea82588d248f409e60a33c6cb (diff) | |
Cleanup pass
Pass to do some cleanups
Diffstat (limited to 'src/main/java/bjc/esodata/PushdownMap.java')
| -rw-r--r-- | src/main/java/bjc/esodata/PushdownMap.java | 30 |
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; } |
