diff options
Diffstat (limited to 'base/src/main/java/bjc/utils/esodata/Tape.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/esodata/Tape.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/base/src/main/java/bjc/utils/esodata/Tape.java b/base/src/main/java/bjc/utils/esodata/Tape.java index 0835f7e..24319c2 100644 --- a/base/src/main/java/bjc/utils/esodata/Tape.java +++ b/base/src/main/java/bjc/utils/esodata/Tape.java @@ -1,5 +1,7 @@ package bjc.utils.esodata; +import com.sun.rowset.internal.InsertRow; + /** * Interface for something that acts like a tape. * @@ -132,4 +134,20 @@ public interface Tape<T> { default boolean atEnd() { return position() == size(); } + + /** + * Append an item to the tape. + * + * By default, uses a fairly non-performant implementation. Should be overidden in subclasses to be more performant. + * @param itm The item to append. + */ + default void append(T itm) { + int pos = position(); + + last(); + + insertAfter(itm); + + seekTo(pos); + } } |
