Java Code Examples for java.util.LinkedList#subList()

The following examples show how to use java.util.LinkedList#subList() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CategorizedCircularBuffer.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
public List<T> subListByKey(K key, int fromIndex, int toIndex) {
    LinkedList<T> typedList = typedLists.get(key);
    if (typedList == null)
        return Collections.EMPTY_LIST;

    return typedList.subList(fromIndex, toIndex);
}
 
Example 2
Source File: DataTest.java    From Iron with Apache License 2.0 4 votes vote down vote up
@Test
public void testPutSubAbstractList() {
    final LinkedList<Person> origin = new LinkedList<>(genPersonList(100));
    List<Person> sublist = origin.subList(10, 30);
    assertThat(testReadWriteWithoutClassCheck(sublist)).isEqualTo(sublist);
}
 
Example 3
Source File: DataTest.java    From Iron with Apache License 2.0 4 votes vote down vote up
@Test
public void testPutSubAbstractList() {
    final LinkedList<Person> origin = new LinkedList<>(genPersonList(100));
    List<Person> sublist = origin.subList(10, 30);
    assertThat(testReadWriteWithoutClassCheck(sublist)).isEqualTo(sublist);
}
 
Example 4
Source File: DataTest.java    From Paper with Apache License 2.0 4 votes vote down vote up
@Test
public void testPutSubAbstractList() {
    final LinkedList<Person> origin = new LinkedList<>(genPersonList(100));
    List<Person> sublist = origin.subList(10, 30);
    testReadWriteWithoutClassCheck(sublist);
}
 
Example 5
Source File: DataTest.java    From Paper with Apache License 2.0 4 votes vote down vote up
@Test
public void testPutSubAbstractList() {
    final LinkedList<Person> origin = new LinkedList<>(genPersonList(100));
    List<Person> sublist = origin.subList(10, 30);
    testReadWriteWithoutClassCheck(sublist);
}