use of org.cytoscape.model.internal.column.ColumnData in project cytoscape-impl by cytoscape.
the class CyTableImpl method isSetX.
private <T> boolean isSetX(final Object key, final String columnName) {
synchronized (lock) {
final String normalizedColName = normalizeColumnName(columnName);
if (primaryKey.equalsIgnoreCase(normalizedColName))
return true;
final VirtualColumn virtColumn = virtualColumnMap.get(normalizedColName);
if (virtColumn != null) {
return virtColumn.getRawValue(key) != null;
} else {
final ColumnData keyToValueMap = attributes.get(normalizedColName);
return keyToValueMap != null && keyToValueMap.get(key) != null;
}
}
}
use of org.cytoscape.model.internal.column.ColumnData in project cytoscape-impl by cytoscape.
the class CyTableImpl method unSetX.
private void unSetX(final Object key, final String columnName) {
synchronized (lock) {
final String normalizedColName = normalizeColumnName(columnName);
final VirtualColumn virtColumn = virtualColumnMap.get(normalizedColName);
if (virtColumn != null)
virtColumn.setValue(key, null);
else {
final ColumnData keyToValueMap = attributes.get(normalizedColName);
if (!types.containsKey(normalizedColName) || keyToValueMap == null)
throw new IllegalArgumentException("column: '" + columnName + "' does not yet exist.");
final Object value = keyToValueMap.get(key);
if (value == null)
return;
keyToValueMap.remove(key);
}
}
if (fireEvents)
eventHelper.addEventPayload((CyTable) this, new RowSetRecord(getRow(key), columnName, null, null), RowsSetEvent.class);
}
Aggregations