Package org.rssowl.core.internal.persist

Examples of org.rssowl.core.internal.persist.LongArrayList


    final EntitiesToBeIndexedDAOImpl dao = DBHelper.getEntitiesToBeIndexedDAO();
    List<IndexingTask> indexingTasks = new ArrayList<IndexingTask>(3);
    if (dao != null) {
      RemovedNewsRefsListener removedNewsRefsListener = new IndexingTask.RemovedNewsRefsListener() {
        public void event(Collection<NewsReference> newsRefs) {
          LongArrayList list = new LongArrayList(newsRefs.size());
          for (NewsReference newsRef : newsRefs)
            list.add(newsRef.getId());
          EntityIdsByEventType entityIdsByEventType = dao.load();
          entityIdsByEventType.removeAll(list, list, list);
          dao.save(entityIdsByEventType);
        }
      };
View Full Code Here


  public EntityIdsByEventType() {
    super();
  }

  public EntityIdsByEventType(EntityIdsByEventType o) {
    fPersistedEntities = new LongArrayList(o.fPersistedEntities);
    fUpdatedEntities = new LongArrayList(o.fUpdatedEntities);
    fRemovedEntities = new LongArrayList(o.fRemovedEntities);
  }
View Full Code Here

    if (sorted) {
      fPersistedEntities = new SortedLongArrayList(DEFAULT_CAPACITY);
      fUpdatedEntities = new SortedLongArrayList(DEFAULT_CAPACITY);
      fRemovedEntities = new SortedLongArrayList(DEFAULT_CAPACITY);
    } else {
      fPersistedEntities = new LongArrayList(DEFAULT_CAPACITY);
      fUpdatedEntities = new LongArrayList(DEFAULT_CAPACITY);
      fRemovedEntities = new LongArrayList(DEFAULT_CAPACITY);
    }
  }
View Full Code Here

    final EntitiesToBeIndexedDAOImpl dao = DBHelper.getEntitiesToBeIndexedDAO();
    List<IndexingTask> indexingTasks = new ArrayList<IndexingTask>(3);
    if (dao != null) {
      RemovedNewsRefsListener removedNewsRefsListener = new IndexingTask.RemovedNewsRefsListener() {
        public void event(Collection<NewsReference> newsRefs) {
          LongArrayList list = new LongArrayList(newsRefs.size());
          for (NewsReference newsRef : newsRefs)
            list.add(newsRef.getId());
          EntityIdsByEventType entityIdsByEventType = dao.load();
          entityIdsByEventType.removeAll(list, list, list);
          dao.save(entityIdsByEventType);
        }
      };
View Full Code Here

  public EntityIdsByEventType() {
    super();
  }

  public EntityIdsByEventType(EntityIdsByEventType o) {
    fPersistedEntities = new LongArrayList(o.fPersistedEntities);
    fUpdatedEntities = new LongArrayList(o.fUpdatedEntities);
    fRemovedEntities = new LongArrayList(o.fRemovedEntities);
  }
View Full Code Here

    if (sorted) {
      fPersistedEntities = new SortedLongArrayList(DEFAULT_CAPACITY);
      fUpdatedEntities = new SortedLongArrayList(DEFAULT_CAPACITY);
      fRemovedEntities = new SortedLongArrayList(DEFAULT_CAPACITY);
    } else {
      fPersistedEntities = new LongArrayList(DEFAULT_CAPACITY);
      fUpdatedEntities = new LongArrayList(DEFAULT_CAPACITY);
      fRemovedEntities = new LongArrayList(DEFAULT_CAPACITY);
    }
  }
View Full Code Here

    return container;
  }

  private void addAll(NewsContainer container, LongArrayList[] newsIds) {
    for (int i = 0; i < newsIds.length && i < container.internalGetNewsIds().length; i++) {
      LongArrayList list = container.internalGetNewsIds()[i];
      for (int j = 0; j < newsIds[i].size(); j++)
        list.add(newsIds[i].get(j));
    }
  }
View Full Code Here

   * Tests that trying to retrieve an index that is not in the list throws the
   * appropriate exception.
   */
  @Test(expected = IndexOutOfBoundsException.class)
  public void testOutOfBounds() {
    LongArrayList list = new LongArrayList(10);
    list.add(0);
    list.add(1);
    list.add(2);
    list.get(3);
  }
View Full Code Here

  /**
   * Test some more API of LongArrayList.
   */
  @Test
  public void testApi() {
    LongArrayList list = new LongArrayList(10);
    list.add(0);
    list.add(1);
    list.add(2);

    assertTrue(list.elementsEqual(new long[] { 0, 1, 2 }));
    assertFalse(list.elementsEqual(new long[] { 1, 6, 2 }));

    assertEquals(2, list.lastIndexOf(2));

    list.removeByIndex(2);
    assertEquals(2, list.size());
    assertFalse(list.isEmpty());
  }
View Full Code Here

  /**
   * Tests copy constructor.
   */
  @Test
  public void testCopyConstructor() {
    LongArrayList list = new LongArrayList(10);
    list.add(0);
    list.add(1);
    list.add(2);
    assertEquals(3, list.size());
    assertEquals(0, list.get(0));
    assertEquals(1, list.get(1));
    assertEquals(2, list.get(2));

    LongArrayList copy = new LongArrayList(list);
    assertEquals(list.size(), copy.size());
    assertEquals(list, copy);
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.internal.persist.LongArrayList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.