|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infovis.column.ConstantColumn
public class ConstantColumn
Column containing constant values for each rows.
Field Summary |
---|
Fields inherited from interface infovis.metadata.Constants |
---|
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE |
Constructor Summary | |
---|---|
ConstantColumn()
|
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener listener)
Adds a listener to the list that's notified each time a change occurs. |
void |
addValue(String v)
Appends the element specified in its String representation to the end of this column. |
boolean |
addValueOrNull(String v)
Appends the element specified in its String representation to the end of this column or adds an undefined object if the String cannot be parsed. |
int |
capacity()
Returns the current capacity of this column. |
void |
clear()
Removes all of the elements from this column. |
int |
compare(int arg0,
int arg1)
|
void |
disableNotify()
Disables notification until enableNotify has been called. |
void |
enableNotify()
Re enable notifications, triggering eventListeners if modifications occur. |
void |
ensureCapacity(int minCapacity)
Increases the capacity of this column, if necessary, to ensure that it can hold at least the number of values specified by the minimum capacity argument. |
String |
format(double value)
Returns the specified value formatted according to this column's format. |
MutableAttributeSet |
getClientProperty()
Returns a MutableAttributeSet associating keys to values holding user-supplied data. |
double |
getDoubleAt(int row)
Returns the value as a double. |
double |
getDoubleMax()
Returns the largset value as a double. |
double |
getDoubleMin()
Returns the smallest value as a double. |
float |
getFloatAt(int row)
Returns the value as a float. |
Format |
getFormat()
Returns the format. |
int |
getIntAt(int row)
Returns the value as an int. |
long |
getLongAt(int row)
Returns the value as a long. |
int |
getMaxIndex()
Returns an the index of a row containing the maximum value of this column or -1 if the column has only undefined values or is empty. |
MutableAttributeSet |
getMetadata()
Returns the MutableAttributeSet associating keys to values for qualifying the data contained in the instance of this interface. |
int |
getMinIndex()
Returns an the index of a row containing the minimum value of this column or -1 if the column has only undefined values or is empty. |
String |
getName()
Returns the column name. |
String |
getValueAt(int index)
Returns the String representation of the element at the specified position in this column or null if
the element is undefined. |
Class |
getValueClass()
Returns the class of the elements. |
boolean |
hasUndefinedValue()
Returns true if the columns contains
undefined values, false otherwise. |
boolean |
isEmpty()
Returns true if this column contains no elements. |
boolean |
isInternal()
Returns true if the column name starts with a '#'. |
boolean |
isValueUndefined(int i)
Returns true if the ith value is undefined. |
RowIterator |
iterator()
Returns a RowIterator over all the valid rows of this column. |
void |
removeChangeListener(ChangeListener listener)
Removes a listener from the list that's notified each time a change occurs. |
double |
round(double value)
Returns the rounded value according to the semantics of this number value. |
void |
setDoubleAt(int row,
double v)
Sets the value as a double. |
void |
setFloatAt(int row,
float v)
Sets the value as a float. |
void |
setFormat(Format format)
Sets the format. |
void |
setIntAt(int row,
int v)
Sets the value as an int. |
void |
setLongAt(int row,
long v)
Sets the value as a long. |
void |
setName(String name)
Sets the column name. |
void |
setSize(int newSize)
Sets the size of this column. |
void |
setValueAt(int index,
String element)
Replaces the element at the specified position in this column with the element specified in its String representation or sets if undefined if the element is null
It will be read and translated using the Format. |
boolean |
setValueOrNullAt(int index,
String v)
Replaces the element at the specified position in this column with the element specified in its String representation or set it undefined if the String cannot be parsed. |
void |
setValueUndefined(int i,
boolean undef)
Sets the ith element to have an undefined value. |
int |
size()
Returns the number of elements in this column. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cern.colt.function.IntComparator |
---|
equals |
Constructor Detail |
---|
public ConstantColumn()
Method Detail |
---|
public int getIntAt(int row)
getIntAt
in interface NumberColumn
row
- the row
public float getFloatAt(int row)
getFloatAt
in interface NumberColumn
row
- the row
public long getLongAt(int row)
getLongAt
in interface NumberColumn
row
- the row
public double getDoubleAt(int row)
getDoubleAt
in interface NumberColumn
row
- the row
public void setIntAt(int row, int v)
setIntAt
in interface NumberColumn
row
- the rowv
- the value as an intpublic void setFloatAt(int row, float v)
setFloatAt
in interface NumberColumn
row
- the rowv
- the value as a floatpublic void setLongAt(int row, long v)
setLongAt
in interface NumberColumn
row
- the rowv
- the value as a longpublic void setDoubleAt(int row, double v)
setDoubleAt
in interface NumberColumn
row
- the rowv
- the value as a doublepublic double getDoubleMin()
getDoubleMin
in interface NumberColumn
public double getDoubleMax()
getDoubleMax
in interface NumberColumn
public double round(double value)
round
in interface NumberColumn
value
- the value to round
public String format(double value)
format
in interface NumberColumn
value
- the value to format
public String getName()
getName
in interface Column
public void setName(String name)
setName
in interface Column
name
- The name to setpublic boolean isInternal()
isInternal
in interface Column
public boolean isValueUndefined(int i)
isValueUndefined
in interface Column
isValueUndefined
in interface RowComparator
i
- the index
public void setValueUndefined(int i, boolean undef)
setValueUndefined
in interface Column
i
- the indexundef
- true if the value should be undefined,
false otherwise.public boolean hasUndefinedValue()
true
if the columns contains
undefined values, false
otherwise.
hasUndefinedValue
in interface Column
true
if the columns contains
undefined values, false
otherwise.public Format getFormat()
getFormat
in interface Column
public void setFormat(Format format)
setFormat
in interface Column
format
- The format to setpublic boolean isEmpty()
isEmpty
in interface Column
public int size()
size
in interface Column
public void setSize(int newSize)
Some column will ignore this request.
setSize
in interface Column
newSize
- the new size.public void clear()
CategoricalFormat
, it
is not cleared so results may not be what you expected. The
CategoricalFormat
can be cleared explicitely if
needed.
clear
in interface Column
public void ensureCapacity(int minCapacity)
ensureCapacity
in interface Column
minCapacity
- the desired minimum capacity.public int capacity()
capacity
in interface Column
public String getValueAt(int index)
null
if
the element is undefined. The representation is
generated by the current format.
getValueAt
in interface Column
index
- index of element representation to return.
null
if the element is undefined.public void setValueAt(int index, String element) throws ParseException
null
It will be read and translated using the Format. A null value
sets the value to undefined. The column is extended if
needed.
setValueAt
in interface Column
index
- index of element to replace.element
- element to be stored at the specified position.
ParseException
- if the specified string cannot be parsed.public boolean setValueOrNullAt(int index, String v)
setValueOrNullAt
in interface Column
index
- index of element to setv
- element to be appended to this column.
public void addValue(String v) throws ParseException
col.addValue(a)
is equivalent to
col.setValueAt(col.size(), a)
.
addValue
in interface Column
v
- element to be appended to this column.
ParseException
- if the specified string
cannot be parsed.public boolean addValueOrNull(String v)
col.addValueOrNull(a)
is equivalent to
col.setValueAtOrNull(col.size(), a)
.
addValueOrNull
in interface Column
v
- element to be appended to this column.
public int getMinIndex()
getMinIndex
in interface Column
public int getMaxIndex()
getMaxIndex
in interface Column
public Class getValueClass()
getValueClass
in interface Column
public void disableNotify()
This method is useful if a large number of modifications is going to happen on the column and notifying each time would be too time consuming. The notification will be deferred until enableNotify is called.
Calls to disableNotify can be nested
disableNotify
in interface Column
Column.enableNotify()
public void enableNotify()
enableNotify
in interface Column
Column.disableNotify()
public void addChangeListener(ChangeListener listener)
addChangeListener
in interface Column
listener
- the listenerpublic void removeChangeListener(ChangeListener listener)
removeChangeListener
in interface Column
listener
- the listenerpublic RowIterator iterator()
iterator
in interface Column
public MutableAttributeSet getMetadata()
getMetadata
in interface Metadata
public MutableAttributeSet getClientProperty()
getClientProperty
in interface Metadata
public int compare(int arg0, int arg1)
compare
in interface IntComparator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |