From f51f6da7319787348c38b875652b5c0e9f88c8aa Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Mon, 13 Apr 2020 18:43:13 -0400 Subject: Cleanup pass Pass to do some cleanups --- src/main/java/bjc/esodata/PushdownMap.java | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/main/java/bjc/esodata/PushdownMap.java') 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 - * The key of the map. + * The key of the map. * * @param - * The values in the map. + * The values in the map. */ public class PushdownMap implements IMap { /* Our backing storage. */ @@ -84,16 +84,15 @@ public class PushdownMap implements IMap @Override public IMap transform(final Function 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 stk = backing.get(key); final ValueType vl = stk.top(); @@ -114,7 +113,7 @@ public class PushdownMap implements IMap public ValueType remove(final KeyType key) { final Stack stk = backing.get(key); - if(stk.size() > 1) { + if (stk.size() > 1) { return stk.pop(); } @@ -138,15 +137,20 @@ public class PushdownMap implements IMap @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; } -- cgit v1.2.3