|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.data.DataColumnSpecCreator
public final class DataColumnSpecCreator
A factory class to create a DataColumnSpec
(as the only way from
outside this package). It can be created from an existing spec or by
specifying a column name and DataType
. Setter functions allow to
overwrite all available members within the creator but the (later) created
DataColumnSpec
will be read-only after creation.
In addition, a ColorHandler
, SizeHandler
, and/or
ShapeHandler
can be set optionally to specify color, shape, and size.
An DataColumnProperties
object can be used to specify annotations as
key-value pairs.
DataColumnSpec
,
createSpec()
Constructor Summary | |
---|---|
DataColumnSpecCreator(DataColumnSpec cspec)
Initializes the creator with a given DataColumnSpec . |
|
DataColumnSpecCreator(String name,
DataType type)
Initializes the creator with the given column name and type. |
Method Summary | |
---|---|
DataColumnSpec |
createSpec()
Creates and returns a new DataColumnSpec using the
internal properties of this creator. |
void |
merge(DataColumnSpec cspec2)
Merges the existing DataColumnSpec with a second
DataColumnSpec . |
void |
removeAllHandlers()
Removes all handlers from this creator which are then set to null for the next call of #createSpec() . |
void |
setColorHandler(ColorHandler colorHdl)
Set (new) ColorHandler which can be null . |
void |
setDomain(DataColumnDomain domain)
Set (new) domain. |
void |
setElementNames(String[] elNames)
Set names of elements when this column contains a vector type. |
void |
setName(String name)
Set (new) column name. |
void |
setProperties(DataColumnProperties props)
Set (new) column properties. |
void |
setShapeHandler(ShapeHandler shapeHdl)
Set (new) ShapeHandler which can be null . |
void |
setSizeHandler(SizeHandler sizeHdl)
Set (new) SizeHandler which can be null . |
void |
setType(DataType type)
Set (new) column type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataColumnSpecCreator(String name, DataType type)
DataColumnProperties
are left empty and color, size, and
shape handler are set to null
.
name
- the column nametype
- the column type
NullPointerException
- if either the column name or type is
null
public DataColumnSpecCreator(DataColumnSpec cspec)
DataColumnSpec
.
cspec
- other specMethod Detail |
---|
public void merge(DataColumnSpec cspec2)
DataColumnSpec
with a second
DataColumnSpec
. If they have equal structure, the domain
information and properties from both DataColumnSpecs is merged,
Color, Shape and Size-Handlers are compared (must be equal).
cspec2
- the second DataColumnSpec
.
IllegalArgumentException
- if the structure (type and name) does
not match, if the domain can not be merged, if the Color-,
Shape- or SizeHandlers are different or the sub element
names are not equal.DataTableSpec.mergeDataTableSpecs(DataTableSpec...)
public void setName(String name)
name
- the (new) column name
NullPointerException
- if the column name is null
public void setElementNames(String[] elNames)
null
, a default name array
will be used when the final DataColumnSpec
is created (the array
will contain the then-actual name of the column).
elNames
- The elements names/identifiers to set.
NullPointerException
- If the argument contains null
elements.DataColumnSpec.getElementNames()
public void setType(DataType type)
type
- the (new) column type
NullPointerException
- if the column type is null
public void setDomain(DataColumnDomain domain)
null
domain is set, an empty domain
will be created.
domain
- the (new) domain, if null
an empty default
domain will be createdpublic void setProperties(DataColumnProperties props)
null
properties object
is passed, a new empty property object will be created.
props
- the (new) properties, if null
an empty props
object is createdpublic void setSizeHandler(SizeHandler sizeHdl)
SizeHandler
which can be null
.
sizeHdl
- the (new) SizeHandler
or null
public void setShapeHandler(ShapeHandler shapeHdl)
ShapeHandler
which can be null
.
shapeHdl
- the (new) ShapeHandler
or
null
public void setColorHandler(ColorHandler colorHdl)
ColorHandler
which can be null
.
colorHdl
- the (new) ColorHandler
or
null
public void removeAllHandlers()
null
for the next call of #createSpec()
.
public DataColumnSpec createSpec()
DataColumnSpec
using the
internal properties of this creator.
DataColumnSpec
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |