test_class.file: parser/src/test/java/com/qihoo/qsql/org/apache/calcite/util/ChunkListTest.java
test_class.identifier: ChunkListTest
test_case.body: @Test public void testChunkList() {
      final ChunkList<Integer> list = new ChunkList<>();
      final ChunkList<Integer> list0 = new ChunkList<>(list);
      final ChunkList<Integer> list1 = new ChunkList<>(list);
      list1.add(123);
      assertEquals(0, list.size());
      assertEquals(0, list0.size());
      assertEquals(1, list1.size());
      assertTrue(list.isEmpty());
      assertEquals("[]", list.toString());
  
      try {
        list.remove(0);
        fail("expected exception");
      } catch (IndexOutOfBoundsException e) {
        // ok
      }
  
      try {
        list.get(-1);
        fail("expected exception");
      } catch (IndexOutOfBoundsException e) {
        // ok
      }
  
      try {
        list.get(0);
        fail("expected exception");
      } catch (IndexOutOfBoundsException e) {
        // ok
      }
  
      list.add(7);
      assertEquals(1, list.size());
      assertEquals(7, (int) list.get(0));
      assertFalse(list.isEmpty());
      assertEquals("[7]", list.toString());
  
      list.add(9);
      list.add(null);
      list.add(11);
      assertEquals(4, list.size());
      assertEquals(7, (int) list.get(0));
      assertEquals(9, (int) list.get(1));
      assertNull(list.get(2));
      assertEquals(11, (int) list.get(3));
      assertFalse(list.isEmpty());
      assertEquals("[7, 9, null, 11]", list.toString());
  
      assertTrue(list.contains(9));
      assertFalse(list.contains(8));
  
      list.addAll(Collections.nCopies(70, 1));
      assertEquals(74, list.size());
      assertEquals(1, (int) list.get(40));
      assertEquals(1, (int) list.get(70));
  
      int n = 0;
      for (Integer integer : list) {
        Util.discard(integer);
        ++n;
      }
      assertEquals(n, list.size());
  
      int i = list.indexOf(null);
      assertEquals(2, i);
  
      // can't sort if null is present
      list.set(2, 123);
  
      i = list.indexOf(null);
      assertEquals(-1, i);
  
      // sort an empty list
      Collections.sort(list0);
      assertThat(list0.isEmpty(), is(true));
  
      // sort a list with 1 element
      Collections.sort(list1);
      assertThat(list1.size(), is(1));
  
      Collections.sort(list);
      assertEquals(74, list.size());
  
      list.remove((Integer) 7);
      Collections.sort(list);
      assertEquals(1, (int) list.get(3));
  
      // remove all instances of a value that exists
      boolean b = list.removeAll(Collections.singletonList(9));
      assertTrue(b);
  
      // remove all instances of a non-existent value
      b = list.removeAll(Collections.singletonList(99));
      assertFalse(b);
  
      // remove all instances of a value that occurs in the last chunk
      list.add(12345);
      b = list.removeAll(Collections.singletonList(12345));
      assertTrue(b);
  
      // remove all instances of a value that occurs in the last chunk but
      // not as the last value
      list.add(12345);
      list.add(123);
      b = list.removeAll(Collections.singletonList(12345));
      assertTrue(b);
  
      assertThat(new ChunkList<>(Collections.nCopies(1000, 77)).size(),
          is(1000));
  
      // add to an empty list via iterator
      //noinspection MismatchedQueryAndUpdateOfCollection
      final ChunkList<String> list2 = new ChunkList<>();
      list2.listIterator(0).add("x");
      assertEquals("[x]", list2.toString());
  
      // add at start
      list2.add(0, "y");
      assertEquals("[y, x]", list2.toString());
  
      list2.remove(0);
      assertEquals("[x]", list2.toString());
  
      // clear a list of length 5, one element at a time, using an iterator
      list2.clear();
      list2.addAll(ImmutableList.of("a", "b", "c", "d", "e"));
      assertThat(list2.size(), is(5));
      final ListIterator<String> listIterator = list2.listIterator(0);
      assertThat(listIterator.next(), is("a"));
      listIterator.remove();
      assertThat(listIterator.next(), is("b"));
      listIterator.remove();
      assertThat(listIterator.next(), is("c"));
      listIterator.remove();
      assertThat(listIterator.next(), is("d"));
      listIterator.remove();
      assertThat(list2.size(), is(1));
      assertThat(listIterator.next(), is("e"));
      listIterator.remove();
      assertThat(list2.size(), is(0));
    }
test_case.class_method_signature: ChunkListTest.testChunkList()
test_case.full_signature: @Test public void testChunkList()
test_case.identifier: testChunkList
test_case.invocations: add assertEquals size assertEquals size assertEquals size assertTrue isEmpty assertEquals toString remove fail get fail get fail add assertEquals size assertEquals get assertFalse isEmpty assertEquals toString add add add assertEquals size assertEquals get assertEquals get assertNull get assertEquals get assertFalse isEmpty assertEquals toString assertTrue contains assertFalse contains addAll nCopies assertEquals size assertEquals get assertEquals get discard assertEquals size indexOf assertEquals set indexOf assertEquals sort assertThat isEmpty is sort assertThat size is sort assertEquals size remove sort assertEquals get removeAll singletonList assertTrue removeAll singletonList assertFalse add removeAll singletonList assertTrue add add removeAll singletonList assertTrue assertThat size nCopies is add listIterator assertEquals toString add assertEquals toString remove assertEquals toString clear addAll of assertThat size is listIterator assertThat next is remove assertThat next is remove assertThat next is remove assertThat next is remove assertThat size is assertThat next is remove assertThat size is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testChunkList()
focal_class.declarator: HEADER_SIZE = 3
focal_class.modifier: private static final
focal_class.original_string: private static final int HEADER_SIZE = 3;
focal_class.type: int
focal_class.var_name: HEADER_SIZE
focal_class.declarator: CHUNK_SIZE = 64
focal_class.modifier: private static final
focal_class.original_string: private static final int CHUNK_SIZE = 64;
focal_class.type: int
focal_class.var_name: CHUNK_SIZE
focal_class.declarator: INTEGERS = new Integer[CHUNK_SIZE + 3]
focal_class.modifier: private static final
focal_class.original_string: private static final Integer[] INTEGERS = new Integer[CHUNK_SIZE + 3];
focal_class.type: Integer[]
focal_class.var_name: INTEGERS
focal_class.declarator: size
focal_class.modifier: private
focal_class.original_string: private int size;
focal_class.type: int
focal_class.var_name: size
focal_class.declarator: first
focal_class.modifier: private
focal_class.original_string: private Object[] first;
focal_class.type: Object[]
focal_class.var_name: first
focal_class.declarator: last
focal_class.modifier: private
focal_class.original_string: private Object[] last;
focal_class.type: Object[]
focal_class.var_name: last
focal_class.file: parser/src/main/java/com/qihoo/qsql/org/apache/calcite/util/ChunkList.java
focal_class.identifier: ChunkList
focal_class.class_method_signature: ChunkList.ChunkList()
focal_class.full_signature: public  ChunkList()
focal_class.identifier: ChunkList
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ChunkList()
focal_class.class_method_signature: ChunkList.ChunkList(Collection<E> collection)
focal_class.full_signature: public  ChunkList(Collection<E> collection)
focal_class.identifier: ChunkList
focal_class.modifiers: public
focal_class.parameters: (Collection<E> collection)
focal_class.signature:  ChunkList(Collection<E> collection)
focal_class.class_method_signature: ChunkList.isValid(boolean fail)
focal_class.full_signature:  boolean isValid(boolean fail)
focal_class.identifier: isValid
focal_class.parameters: (boolean fail)
focal_class.return: boolean
focal_class.signature: boolean isValid(boolean fail)
focal_class.class_method_signature: ChunkList.listIterator(int index)
focal_class.full_signature: @Override public ListIterator<E> listIterator(int index)
focal_class.identifier: listIterator
focal_class.modifiers: @Override public
focal_class.parameters: (int index)
focal_class.return: ListIterator<E>
focal_class.signature: ListIterator<E> listIterator(int index)
focal_class.class_method_signature: ChunkList.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: ChunkList.clear()
focal_class.full_signature: @Override public void clear()
focal_class.identifier: clear
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: ChunkList.add(E element)
focal_class.full_signature: @Override public boolean add(E element)
focal_class.identifier: add
focal_class.modifiers: @Override public
focal_class.parameters: (E element)
focal_class.return: boolean
focal_class.signature: boolean add(E element)
focal_class.class_method_signature: ChunkList.add(int index, E element)
focal_class.full_signature: @Override public void add(int index, E element)
focal_class.identifier: add
focal_class.modifiers: @Override public
focal_class.parameters: (int index, E element)
focal_class.return: void
focal_class.signature: void add(int index, E element)
focal_class.class_method_signature: ChunkList.prev(Object[] chunk)
focal_class.full_signature: private static Object[] prev(Object[] chunk)
focal_class.identifier: prev
focal_class.modifiers: private static
focal_class.parameters: (Object[] chunk)
focal_class.return: Object[]
focal_class.signature: Object[] prev(Object[] chunk)
focal_class.class_method_signature: ChunkList.setPrev(Object[] chunk, Object[] prev)
focal_class.full_signature: private static void setPrev(Object[] chunk, Object[] prev)
focal_class.identifier: setPrev
focal_class.modifiers: private static
focal_class.parameters: (Object[] chunk, Object[] prev)
focal_class.return: void
focal_class.signature: void setPrev(Object[] chunk, Object[] prev)
focal_class.class_method_signature: ChunkList.next(Object[] chunk)
focal_class.full_signature: private static Object[] next(Object[] chunk)
focal_class.identifier: next
focal_class.modifiers: private static
focal_class.parameters: (Object[] chunk)
focal_class.return: Object[]
focal_class.signature: Object[] next(Object[] chunk)
focal_class.class_method_signature: ChunkList.setNext(Object[] chunk, Object[] next)
focal_class.full_signature: private static void setNext(Object[] chunk, Object[] next)
focal_class.identifier: setNext
focal_class.modifiers: private static
focal_class.parameters: (Object[] chunk, Object[] next)
focal_class.return: void
focal_class.signature: void setNext(Object[] chunk, Object[] next)
focal_class.class_method_signature: ChunkList.occupied(Object[] chunk)
focal_class.full_signature: private static int occupied(Object[] chunk)
focal_class.identifier: occupied
focal_class.modifiers: private static
focal_class.parameters: (Object[] chunk)
focal_class.return: int
focal_class.signature: int occupied(Object[] chunk)
focal_class.class_method_signature: ChunkList.setOccupied(Object[] chunk, int size)
focal_class.full_signature: private static void setOccupied(Object[] chunk, int size)
focal_class.identifier: setOccupied
focal_class.modifiers: private static
focal_class.parameters: (Object[] chunk, int size)
focal_class.return: void
focal_class.signature: void setOccupied(Object[] chunk, int size)
focal_class.class_method_signature: ChunkList.element(Object[] chunk, int index)
focal_class.full_signature: private static Object element(Object[] chunk, int index)
focal_class.identifier: element
focal_class.modifiers: private static
focal_class.parameters: (Object[] chunk, int index)
focal_class.return: Object
focal_class.signature: Object element(Object[] chunk, int index)
focal_class.class_method_signature: ChunkList.setElement(Object[] chunk, int index, Object element)
focal_class.full_signature: private static void setElement(Object[] chunk, int index, Object element)
focal_class.identifier: setElement
focal_class.modifiers: private static
focal_class.parameters: (Object[] chunk, int index, Object element)
focal_class.return: void
focal_class.signature: void setElement(Object[] chunk, int index, Object element)
focal_class.class_method_signature: ChunkList.locate(int index)
focal_class.full_signature: private ChunkListIterator locate(int index)
focal_class.identifier: locate
focal_class.modifiers: private
focal_class.parameters: (int index)
focal_class.return: ChunkListIterator
focal_class.signature: ChunkListIterator locate(int index)
focal_class.superclass: extends AbstractSequentialList<E>
focal_method.body: public ChunkList() {
    }
focal_method.class_method_signature: ChunkList.ChunkList()
focal_method.full_signature: public  ChunkList()
focal_method.identifier: ChunkList
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.signature:  ChunkList()