test_class.file: reactfx/src/test/java/org/reactfx/collection/MemoizationListTest.java
test_class.identifier: MemoizationListTest
test_case.body: @Test
      public void testForce() {
          LiveList<Integer> source = new LiveArrayList<>(0, 1, 2, 3, 4, 5, 6);
          MemoizationList<Integer> memoizing = source.memoize();
          LiveList<Integer> memoized = memoizing.memoizedItems();
  
          memoizing.pin(); // otherwise no memoization takes place
  
          memoizing.get(3);
          // _ _ _ 3 _ _ _
          assertEquals(Collections.singletonList(3), memoized);
  
          Counter counter = new Counter();
          memoized.observeChanges(ch -> {
              counter.inc();
              assertEquals(2, ch.getModificationCount());
              ListModification<?> mod1 = ch.getModifications().get(0);
              ListModification<?> mod2 = ch.getModifications().get(1);
              assertEquals(0, mod1.getFrom());
              assertEquals(0, mod1.getRemovedSize());
              assertEquals(Arrays.asList(1, 2), mod1.getAddedSubList());
              assertEquals(3, mod2.getFrom());
              assertEquals(0, mod2.getRemovedSize());
              assertEquals(Arrays.asList(4, 5), mod2.getAddedSubList());
          });
  
          memoizing.force(1, 6);
          assertEquals(1, counter.get());
      }
test_case.class_method_signature: MemoizationListTest.testForce()
test_case.full_signature: @Test public void testForce()
test_case.identifier: testForce
test_case.invocations: memoize memoizedItems pin get assertEquals singletonList observeChanges inc assertEquals getModificationCount get getModifications get getModifications assertEquals getFrom assertEquals getRemovedSize assertEquals asList getAddedSubList assertEquals getFrom assertEquals getRemovedSize assertEquals asList getAddedSubList force assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testForce()
focal_class.declarator: sparseList = new SparseList<>()
focal_class.modifier: private final
focal_class.original_string: private final SparseList<E> sparseList = new SparseList<>();
focal_class.type: SparseList<E>
focal_class.var_name: sparseList
focal_class.declarator: memoizedItems = new MemoizedView()
focal_class.modifier: private final
focal_class.original_string: private final MemoizedView memoizedItems = new MemoizedView();
focal_class.type: MemoizedView
focal_class.var_name: memoizedItems
focal_class.declarator: source
focal_class.modifier: private final
focal_class.original_string: private final ObservableList<E> source;
focal_class.type: ObservableList<E>
focal_class.var_name: source
focal_class.file: reactfx/src/main/java/org/reactfx/collection/MemoizationList.java
focal_class.identifier: MemoizationListImpl
focal_class.interfaces: implements MemoizationList<E>, UnmodifiableByDefaultLiveList<E>
focal_class.class_method_signature: MemoizationListImpl.MemoizationListImpl(ObservableList<E> source)
focal_class.full_signature:   MemoizationListImpl(ObservableList<E> source)
focal_class.identifier: MemoizationListImpl
focal_class.parameters: (ObservableList<E> source)
focal_class.signature:  MemoizationListImpl(ObservableList<E> source)
focal_class.class_method_signature: MemoizationListImpl.observeInputs()
focal_class.full_signature: @Override protected Subscription observeInputs()
focal_class.identifier: observeInputs
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: Subscription
focal_class.signature: Subscription observeInputs()
focal_class.class_method_signature: MemoizationListImpl.sourceChanged(QuasiListChange<? extends E> qc)
focal_class.full_signature: private void sourceChanged(QuasiListChange<? extends E> qc)
focal_class.identifier: sourceChanged
focal_class.modifiers: private
focal_class.parameters: (QuasiListChange<? extends E> qc)
focal_class.return: void
focal_class.signature: void sourceChanged(QuasiListChange<? extends E> qc)
focal_class.class_method_signature: MemoizationListImpl.get(int index)
focal_class.full_signature: @Override public E get(int index)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (int index)
focal_class.return: E
focal_class.signature: E get(int index)
focal_class.class_method_signature: MemoizationListImpl.force(int from, int to)
focal_class.full_signature: @Override public void force(int from, int to)
focal_class.identifier: force
focal_class.modifiers: @Override public
focal_class.parameters: (int from, int to)
focal_class.return: void
focal_class.signature: void force(int from, int to)
focal_class.class_method_signature: MemoizationListImpl.size()
focal_class.full_signature: @Override public int size()
focal_class.identifier: size
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int size()
focal_class.class_method_signature: MemoizationListImpl.memoizedItems()
focal_class.full_signature: @Override public LiveList<E> memoizedItems()
focal_class.identifier: memoizedItems
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: LiveList<E>
focal_class.signature: LiveList<E> memoizedItems()
focal_class.class_method_signature: MemoizationListImpl.isMemoized(int index)
focal_class.full_signature: @Override public boolean isMemoized(int index)
focal_class.identifier: isMemoized
focal_class.modifiers: @Override public
focal_class.parameters: (int index)
focal_class.return: boolean
focal_class.signature: boolean isMemoized(int index)
focal_class.class_method_signature: MemoizationListImpl.getIfMemoized(int index)
focal_class.full_signature: @Override public Optional<E> getIfMemoized(int index)
focal_class.identifier: getIfMemoized
focal_class.modifiers: @Override public
focal_class.parameters: (int index)
focal_class.return: Optional<E>
focal_class.signature: Optional<E> getIfMemoized(int index)
focal_class.class_method_signature: MemoizationListImpl.getMemoizedCountBefore(int position)
focal_class.full_signature: @Override public int getMemoizedCountBefore(int position)
focal_class.identifier: getMemoizedCountBefore
focal_class.modifiers: @Override public
focal_class.parameters: (int position)
focal_class.return: int
focal_class.signature: int getMemoizedCountBefore(int position)
focal_class.class_method_signature: MemoizationListImpl.getMemoizedCountAfter(int position)
focal_class.full_signature: @Override public int getMemoizedCountAfter(int position)
focal_class.identifier: getMemoizedCountAfter
focal_class.modifiers: @Override public
focal_class.parameters: (int position)
focal_class.return: int
focal_class.signature: int getMemoizedCountAfter(int position)
focal_class.class_method_signature: MemoizationListImpl.getMemoizedCount()
focal_class.full_signature: @Override public int getMemoizedCount()
focal_class.identifier: getMemoizedCount
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMemoizedCount()
focal_class.class_method_signature: MemoizationListImpl.forget(int from, int to)
focal_class.full_signature: @Override public void forget(int from, int to)
focal_class.identifier: forget
focal_class.modifiers: @Override public
focal_class.parameters: (int from, int to)
focal_class.return: void
focal_class.signature: void forget(int from, int to)
focal_class.class_method_signature: MemoizationListImpl.indexOfMemoizedItem(int index)
focal_class.full_signature: @Override public int indexOfMemoizedItem(int index)
focal_class.identifier: indexOfMemoizedItem
focal_class.modifiers: @Override public
focal_class.parameters: (int index)
focal_class.return: int
focal_class.signature: int indexOfMemoizedItem(int index)
focal_class.class_method_signature: MemoizationListImpl.getMemoizedItemsRange()
focal_class.full_signature: @Override public IndexRange getMemoizedItemsRange()
focal_class.identifier: getMemoizedItemsRange
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: IndexRange
focal_class.signature: IndexRange getMemoizedItemsRange()
focal_class.superclass: extends LiveListBase<E>
focal_method.body: @Override
      public void force(int from, int to) {
          if(!isObservingInputs()) { // memoization is off
              throw new IllegalStateException(
                      "Cannot force items when memoization is off."
                      + " To turn memoization on, you have to be observing this"
                      + " list or its memoizedItems.");
          }
  
          Lists.checkRange(from, to, size());
          for(int i = from; i < to; ++i) {
              if(!sparseList.isPresent(i)) {
                  E elem = source.get(i);
                  if(sparseList.setIfAbsent(i, elem)) {
                      int presentBefore = sparseList.getPresentCountBefore(i);
                      memoizedItems.prepareNotifications(ProperLiveList.elemInsertion(presentBefore));
                  }
              }
          }
          memoizedItems.publishNotifications();
      }
focal_method.class_method_signature: MemoizationListImpl.force(int from, int to)
focal_method.full_signature: @Override public void force(int from, int to)
focal_method.identifier: force
focal_method.invocations: isObservingInputs checkRange size isPresent get setIfAbsent getPresentCountBefore prepareNotifications elemInsertion publishNotifications
focal_method.modifiers: @Override public
focal_method.parameters: (int from, int to)
focal_method.return: void
focal_method.signature: void force(int from, int to)