@Test public void testToArray() { ColumnStore<Node> store = new ColumnStore<Node>(Node.class, false); Assert.assertEquals(store.toArray().length, 0); ColumnImpl col11 = new ColumnImpl("0", Integer.class, null, null, Origin.DATA, false, false); ColumnImpl col12 = new ColumnImpl("1", String.class, "title", "default", Origin.PROPERTY, false, false); store.addColumn(col11); store.addColumn(col12); Column[] cols = store.toArray(); Assert.assertEquals(cols.length, 2); Assert.assertSame(cols[0], col11); Assert.assertEquals(cols[1], col12); }
@Override public ColumnImpl[] toArray() { lock(); try { ColumnImpl[] cols = new ColumnImpl[size()]; int j = 0; for (int i = 0; i < length; i++) { ColumnImpl c = columns[i]; if (c != null) { cols[j++] = c; } } return cols; } finally { unlock(); } }
ColumnStore implements ColumnIterable { @Override public ColumnImpl[] toArray() { lock(); try { ColumnImpl[] cols = new ColumnImpl[size()]; int j = 0; for (int i = 0; i < length; i++) { ColumnImpl c = columns[i]; if (c != null) { cols[j++] = c; } } return cols; } finally { unlock(); } } }
ColumnStore implements ColumnIterable { @Override public ColumnImpl[] toArray() { lock(); try { ColumnImpl[] cols = new ColumnImpl[size()]; int j = 0; for (int i = 0; i < length; i++) { ColumnImpl c = columns[i]; if (c != null) { cols[j++] = c; } } return cols; } finally { unlock(); } } ColumnStore(Class<T> elementType, boolean indexed);  ColumnStore(GraphStore graphStore, Class<T> elementType, boolean indexed); }
ColumnStore implements ColumnIterable { @Override public ColumnImpl[] toArray() { lock(); try { ColumnImpl[] cols = new ColumnImpl[size()]; int j = 0; for (int i = 0; i < length; i++) { ColumnImpl c = columns[i]; if (c != null) { cols[j++] = c; } } return cols; } finally { unlock(); } } ColumnStore(Class<T> elementType, boolean indexed);  ColumnStore(GraphStore graphStore, Class<T> elementType, boolean indexed); void addColumn(final Column column); void removeColumn(final Column column); void removeColumn(final String key); int getColumnIndex(final String key); Column getColumnByIndex(final int index); Column getColumn(final String key); boolean hasColumn(String key); @Override Iterator<Column> iterator(); @Override ColumnImpl[] toArray(); @Override List<Column> toList(); @Override void doBreak(); Set<String> getColumnKeys(); void clear(); int size(); boolean deepEquals(ColumnStore<T> obj); int deepHashCode(); }
ColumnStore implements ColumnIterable { @Override public ColumnImpl[] toArray() { lock(); try { ColumnImpl[] cols = new ColumnImpl[size()]; int j = 0; for (int i = 0; i < length; i++) { ColumnImpl c = columns[i]; if (c != null) { cols[j++] = c; } } return cols; } finally { unlock(); } } ColumnStore(Class<T> elementType, boolean indexed);  ColumnStore(GraphStore graphStore, Class<T> elementType, boolean indexed); void addColumn(final Column column); void removeColumn(final Column column); void removeColumn(final String key); int getColumnIndex(final String key); Column getColumnByIndex(final int index); Column getColumn(final String key); boolean hasColumn(String key); @Override Iterator<Column> iterator(); @Override ColumnImpl[] toArray(); @Override List<Column> toList(); @Override void doBreak(); Set<String> getColumnKeys(); void clear(); int size(); boolean deepEquals(ColumnStore<T> obj); int deepHashCode();  }