Skip to content

Commit

Permalink
Add method MemoizationList.getMemoizedCount().
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasMikula committed Feb 9, 2015
1 parent f242a67 commit b16225b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public interface MemoizationList<E> extends LiveList<E> {
LiveList<E> memoizedItems();
boolean isMemoized(int index);
Optional<E> getIfMemoized(int index);
int getMemoizedCount();
int getMemoizedCountBefore(int position);
int getMemoizedCountAfter(int position);
void forget(int from, int to);
Expand Down Expand Up @@ -165,6 +166,11 @@ public int getMemoizedCountAfter(int position) {
: 0;
}

@Override
public int getMemoizedCount() {
return memoizedItems.size();
}

@Override
public void forget(int from, int to) {
if(!isObservingInputs()) { // memoization is off
Expand Down

0 comments on commit b16225b

Please sign in to comment.