@Test(expectedExceptions = ClassCastException.class) public void testAddColumnAnonymousClass() { ColumnStore<Node> store = new ColumnStore(Node.class, false); store.addColumn(new Column() { @Override public String getId() { throw new UnsupportedOperationException("Not supported yet."); } @Override public int getIndex() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getTitle() { throw new UnsupportedOperationException("Not supported yet."); } @Override public Class getTypeClass() { throw new UnsupportedOperationException("Not supported yet."); } @Override public Origin getOrigin() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean isIndexed() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean isArray() { throw new UnsupportedOperationException("Not supported yet."); } @Override public Object getDefaultValue() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean isDynamic() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean isNumber() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean isProperty() { throw new UnsupportedOperationException("Not supported yet."); } @Override public Table getTable() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean isReadOnly() { throw new UnsupportedOperationException("Not supported yet."); } @Override public ColumnObserver createColumnObserver(boolean withDiff) { throw new UnsupportedOperationException("Not supported yet."); } @Override public Estimator getEstimator() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void setEstimator(Estimator estimator) { throw new UnsupportedOperationException("Not supported yet."); } }); }
public void addColumn(final Column column) { checkNonNullColumnObject(column); checkIndexStatus(column); lock(); try { final ColumnImpl columnImpl = (ColumnImpl) column; short id = idMap.getShort(columnImpl.getId()); if (id == NULL_SHORT) { if (!garbageQueue.isEmpty()) { id = garbageQueue.firstShort(); garbageQueue.remove(id); } else { id = intToShort(length); if (length >= MAX_SIZE) { throw new RuntimeException("Maximum number of columns reached at " + MAX_SIZE); } length++; } idMap.put(column.getId(), id); int intIndex = shortToInt(id); columnImpl.setStoreId(intIndex); columns[intIndex] = columnImpl; if (indexStore != null) { indexStore.addColumn(columnImpl); } updateConfiguration(column); } else { throw new IllegalArgumentException("The column already exist"); } } finally { unlock(); } }
ColumnStore implements ColumnIterable { public void addColumn(final Column column) { checkNonNullColumnObject(column); checkIndexStatus(column); lock(); try { final ColumnImpl columnImpl = (ColumnImpl) column; short id = idMap.getShort(columnImpl.getId()); if (id == NULL_SHORT) { if (!garbageQueue.isEmpty()) { id = garbageQueue.firstShort(); garbageQueue.remove(id); } else { id = intToShort(length); if (length >= MAX_SIZE) { throw new RuntimeException("Maximum number of columns reached at " + MAX_SIZE); } length++; } idMap.put(column.getId(), id); int intIndex = shortToInt(id); columnImpl.setStoreId(intIndex); columns[intIndex] = columnImpl; if (indexStore != null) { indexStore.addColumn(columnImpl); } updateConfiguration(column); } else { throw new IllegalArgumentException("The column already exist"); } } finally { unlock(); } } }
ColumnStore implements ColumnIterable { public void addColumn(final Column column) { checkNonNullColumnObject(column); checkIndexStatus(column); lock(); try { final ColumnImpl columnImpl = (ColumnImpl) column; short id = idMap.getShort(columnImpl.getId()); if (id == NULL_SHORT) { if (!garbageQueue.isEmpty()) { id = garbageQueue.firstShort(); garbageQueue.remove(id); } else { id = intToShort(length); if (length >= MAX_SIZE) { throw new RuntimeException("Maximum number of columns reached at " + MAX_SIZE); } length++; } idMap.put(column.getId(), id); int intIndex = shortToInt(id); columnImpl.setStoreId(intIndex); columns[intIndex] = columnImpl; if (indexStore != null) { indexStore.addColumn(columnImpl); } updateConfiguration(column); } else { throw new IllegalArgumentException("The column already exist"); } } finally { unlock(); } } ColumnStore(Class<T> elementType, boolean indexed);  ColumnStore(GraphStore graphStore, Class<T> elementType, boolean indexed); }
ColumnStore implements ColumnIterable { public void addColumn(final Column column) { checkNonNullColumnObject(column); checkIndexStatus(column); lock(); try { final ColumnImpl columnImpl = (ColumnImpl) column; short id = idMap.getShort(columnImpl.getId()); if (id == NULL_SHORT) { if (!garbageQueue.isEmpty()) { id = garbageQueue.firstShort(); garbageQueue.remove(id); } else { id = intToShort(length); if (length >= MAX_SIZE) { throw new RuntimeException("Maximum number of columns reached at " + MAX_SIZE); } length++; } idMap.put(column.getId(), id); int intIndex = shortToInt(id); columnImpl.setStoreId(intIndex); columns[intIndex] = columnImpl; if (indexStore != null) { indexStore.addColumn(columnImpl); } updateConfiguration(column); } else { throw new IllegalArgumentException("The column already exist"); } } 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 { public void addColumn(final Column column) { checkNonNullColumnObject(column); checkIndexStatus(column); lock(); try { final ColumnImpl columnImpl = (ColumnImpl) column; short id = idMap.getShort(columnImpl.getId()); if (id == NULL_SHORT) { if (!garbageQueue.isEmpty()) { id = garbageQueue.firstShort(); garbageQueue.remove(id); } else { id = intToShort(length); if (length >= MAX_SIZE) { throw new RuntimeException("Maximum number of columns reached at " + MAX_SIZE); } length++; } idMap.put(column.getId(), id); int intIndex = shortToInt(id); columnImpl.setStoreId(intIndex); columns[intIndex] = columnImpl; if (indexStore != null) { indexStore.addColumn(columnImpl); } updateConfiguration(column); } else { throw new IllegalArgumentException("The column already exist"); } } 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();  }