From 504ca816530efdff06bc202e0432ebd354aec304 Mon Sep 17 00:00:00 2001 From: EVE Date: Tue, 14 Mar 2017 12:07:14 -0400 Subject: Cleanup --- .../main/java/bjc/utils/esodata/TapeLibrary.java | 60 +++++++++++----------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/esodata/TapeLibrary.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/esodata/TapeLibrary.java b/BJC-Utils2/src/main/java/bjc/utils/esodata/TapeLibrary.java index 3a49175..732f579 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/esodata/TapeLibrary.java +++ b/BJC-Utils2/src/main/java/bjc/utils/esodata/TapeLibrary.java @@ -8,7 +8,7 @@ import java.util.Map; * * It has a current tape that you can do operations to, but also operations to * add/remove other tapes. - * + * * If there is no tape currently loaded into the changer, all the methods will * either return null/false. * @@ -16,8 +16,8 @@ import java.util.Map; * The element type of the tapes. */ public class TapeLibrary implements Tape { - private Map> tapes; - private Tape currentTape; + private Map> tapes; + private Tape currentTape; /** * Create a new empty tape library. @@ -31,9 +31,9 @@ public class TapeLibrary implements Tape { * * @return The item the tape is on. */ + @Override public T item() { - if (currentTape == null) - return null; + if(currentTape == null) return null; return currentTape.item(); } @@ -44,9 +44,9 @@ public class TapeLibrary implements Tape { * @param itm * The new value for the tape item. */ + @Override public void item(T itm) { - if (currentTape == null) - return; + if(currentTape == null) return; currentTape.item(itm); } @@ -56,9 +56,9 @@ public class TapeLibrary implements Tape { * * @return The current number of elements in the tape. */ + @Override public int size() { - if (currentTape == null) - return 0; + if(currentTape == null) return 0; return currentTape.size(); } @@ -69,9 +69,9 @@ public class TapeLibrary implements Tape { * @param itm * The item to add. */ + @Override public void insertBefore(T itm) { - if (currentTape == null) - return; + if(currentTape == null) return; currentTape.insertBefore(itm); } @@ -79,24 +79,24 @@ public class TapeLibrary implements Tape { /** * Insert an element after the current item. */ + @Override public void insertAfter(T itm) { - if (currentTape == null) - return; + if(currentTape == null) return; currentTape.insertAfter(itm); } /** * Remove the current element. - * + * * Also moves the cursor back one step if possible to maintain relative * position, and removes the corresponding item from the non-active side * * @return The removed item from the active side. */ + @Override public T remove() { - if (currentTape == null) - return null; + if(currentTape == null) return null; return currentTape.remove(); } @@ -104,9 +104,9 @@ public class TapeLibrary implements Tape { /** * Move the cursor to the left-most position. */ + @Override public void first() { - if (currentTape == null) - return; + if(currentTape == null) return; currentTape.first(); } @@ -114,9 +114,9 @@ public class TapeLibrary implements Tape { /** * Move the cursor the right-most position. */ + @Override public void last() { - if (currentTape == null) - return; + if(currentTape == null) return; currentTape.last(); } @@ -128,6 +128,7 @@ public class TapeLibrary implements Tape { * * @return True if the cursor was moved left. */ + @Override public boolean left() { return left(1); } @@ -143,9 +144,9 @@ public class TapeLibrary implements Tape { * * @return True if the cursor was moved left. */ + @Override public boolean left(int amt) { - if (currentTape == null) - return false; + if(currentTape == null) return false; return currentTape.left(amt); } @@ -157,6 +158,7 @@ public class TapeLibrary implements Tape { * * @return Whether the cursor was moved right. */ + @Override public boolean right() { return right(1); } @@ -171,9 +173,9 @@ public class TapeLibrary implements Tape { * * @return Whether the cursor was moved right. */ + @Override public boolean right(int amt) { - if (currentTape == null) - return false; + if(currentTape == null) return false; return currentTape.right(amt); } @@ -187,18 +189,16 @@ public class TapeLibrary implements Tape { * If the current tape is not double-sided, does nothing. */ public void flip() { - if (currentTape == null) - return; + if(currentTape == null) return; - if (currentTape.isDoubleSided()) { + if(currentTape.isDoubleSided()) { ((DoubleTape) currentTape).flip(); } } @Override public boolean isDoubleSided() { - if (currentTape == null) - return false; + if(currentTape == null) return false; return currentTape.isDoubleSided(); } @@ -224,7 +224,7 @@ public class TapeLibrary implements Tape { * @return Whether or not the next tape was loaded. */ public boolean switchTape(String label) { - if (tapes.containsKey(label)) { + if(tapes.containsKey(label)) { currentTape = tapes.get(label); return true; } -- cgit v1.2.3