diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-04-12 13:13:42 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-04-12 13:13:42 -0400 |
| commit | 9052ed6da37af23ea82588d248f409e60a33c6cb (patch) | |
| tree | e816d2032e0a550754712bbae836cdb11383e291 /src/main/java/bjc/esodata/Tape.java | |
| parent | 13aec7074fb0583a72112376df7b8764b0823ce0 (diff) | |
Finish up extraction
This applies the changes that were necessary to complete the extraction
of these packages from bjc-utils
Diffstat (limited to 'src/main/java/bjc/esodata/Tape.java')
| -rw-r--r-- | src/main/java/bjc/esodata/Tape.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/bjc/esodata/Tape.java b/src/main/java/bjc/esodata/Tape.java index 080e216..7d5fd9a 100644 --- a/src/main/java/bjc/esodata/Tape.java +++ b/src/main/java/bjc/esodata/Tape.java @@ -132,4 +132,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); + } } |
