public interface CyColumn
A column name can be broken down into two parts, a "namespace" and a "name". The namespace and name can be combined into a String by separating them with a "::", for example: "MyNamespace::MyName". The namespace part is optional, for example the column name "MyName" does not have a namespace. All methods that take a namespace argument will accept null to indicate no namespace. All of the default network columns created by Cytoscape do not have a namespace.
Apps are encouraged to put any columns they create into a namespace. The advantages of doing this are:
Case is ignored when column names are compared, or example "MyColumnName" and "mycolumnname" are equivalent. This also applies to namespaces, for example "MyNamespace::MyName" and "mynamespace::myname" are equivalent.
Whitespace is significant in both the namespace and the name (for historical reasons), for example " mynamespace ::myname" is in the namespace " mynamespace ". The empty string is a valid name for a namespace, for example "::myname" is in the "" namespace. It is highly recommended not to use whitespace in namespace identifiers, stick with alphanumeric characters and underscores.
Pick a namespace identifier that is between 6-15 characters in length that does not contain whitespace or special characters. Good examples are "EnrichmentMap", "clusterMaker" or "WordCloud".
Module: model-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>model-api</artifactId> </dependency>
Modifier and Type | Field and Description |
---|---|
static String |
NAMESPACE_SEPARATOR |
Modifier and Type | Method and Description |
---|---|
Object |
getDefaultValue()
Returns the default value for the column, possibly null.
|
Class<?> |
getListElementType()
Returns the data type of the list elements if the column type is List.class otherwise null.
|
String |
getName()
Returns the fully-qualified name of the column.
|
default String |
getNameOnly()
Returns the name portion without the namespace.
|
default String |
getNamespace()
Returns the namespace of the column, or null if the column does not have a namespace.
|
CyTable |
getTable()
Returns the table for this column.
|
Class<?> |
getType()
Returns the data type of the column.
|
<T> List<T> |
getValues(Class<? extends T> type)
Returns all the values, some of which may be null, for this given column.
|
VirtualColumnInfo |
getVirtualColumnInfo()
Returns information about the virtual column definition of this column.
|
boolean |
isImmutable()
Returns true if the column is immutable i.e.
|
boolean |
isPrimaryKey()
Returns true if the column is the primary key, otherwise false.
|
static String |
joinColumnName(String namespace,
String name)
Joins a namespace and a name string into a fully-qualified column name.
|
void |
setName(String fullyQualifiedName)
Change the name of this column.
|
default void |
setName(String namespace,
String name)
Change the name of this column.
|
static String[] |
splitColumnName(String fullyQualifiedName)
Splits a column name into a namespace part and a name part at the first occurrence of a "::".
|
static final String NAMESPACE_SEPARATOR
static String[] splitColumnName(String fullyQualifiedName)
static String joinColumnName(String namespace, String name)
joinColumnName("MyNamespace", "MyName")
results in "MyNamespace::MyName"
.String getName()
default String getNamespace()
default String getNameOnly()
void setName(String fullyQualifiedName)
newName
- the new fully qualified column nameIllegalArgumentException
- if the column is immutabledefault void setName(String namespace, String name)
namespace
- the new namespace, use null to indicate no namespacename
- the new nameIllegalArgumentException
- if the column is immutableClass<?> getType()
Class<?> getListElementType()
boolean isPrimaryKey()
boolean isImmutable()
CyTable getTable()
<T> List<T> getValues(Class<? extends T> type)
T
- the generic type of the column.type
- the datatype of this column. (You can use getType() to obtain it.)VirtualColumnInfo getVirtualColumnInfo()
VirtualColumnInfo
.Object getDefaultValue()
Copyright 2011-2015 Cytoscape Consortium. All rights reserved.