|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infovis.utils.ChangeManager infovis.column.AbstractColumn infovis.column.BasicColumn infovis.column.BasicObjectColumn
public abstract class BasicObjectColumn
Abstract base class for columns containing objects.
Field Summary |
---|
Fields inherited from class infovis.column.AbstractColumn |
---|
MODIFIED_ALL, MODIFIED_NONE |
Fields inherited from interface infovis.metadata.Constants |
---|
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE |
Constructor Summary | |
---|---|
BasicObjectColumn(String name)
Creates a new StringColumn object. |
|
BasicObjectColumn(String name,
int reserve)
Creates a new ObjectColumn object. |
Method Summary | |
---|---|
void |
add(Object element)
Adds a new element in the column. |
int |
capacity()
Returns the current capacity of this column. |
void |
clear()
Removes all of the elements from this column. The Column will be empty after this call returns. WARNING: if there is an associated format that maintains a status, such as a CategoricalFormat , it
is not cleared so results may not be what you expected. The
CategoricalFormat can be cleared explicitely if
needed. |
int |
compare(int row1,
int row2)
|
int |
compare(Object s1,
Object s2)
Compare two objects using this object's comparator. |
boolean |
compareValues(Column c)
Compare the values of this column and the specified column. |
abstract Object |
definedValue()
Returns the instance of a value defined with the right type for this column. |
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. |
void |
fill(Object val)
Fills the column with the specified value. |
String |
format(Object v)
Returns the string representation of a value according to the current format. |
Object |
getObjectAt(int index)
Returns the element at the specified position or null if
it is undefined or invalid. |
Comparator |
getOrder()
Returns the order used to find the min and max for the strings. |
String |
getValueAt(int i)
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. |
ArrayList |
getValueReference()
Returns the backing ArrayList for this column (USE WITH CARE). |
boolean |
hasUndefinedValue()
Returns true if the columns contains
undefined values, false otherwise. |
int |
indexOf(Object o)
Returns the index of the specified object in the column. |
boolean |
isValueUndefined(int index)
Returns true if the ith value is undefined. |
Object |
parse(String v)
Parse a string and return the value for the column. |
void |
remove(int row)
Removes the specified row. |
boolean |
remove(Object o)
Removes the specified object from the column if it exists. |
void |
setExtend(int index,
Object element)
Replaces the element at the specified position in this column with the specified element, growing the column if necessary. |
void |
setObjectAt(int index,
Object element)
Replaces the element at the specified position in this column with the specified element. |
void |
setOrder(Comparator order)
Sets the order used to find the min and max for the strings. |
void |
setSize(int newSize)
Sets the sizeColumn of this column. |
void |
setValueAt(int i,
String v)
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. |
void |
setValueUndefined(int index,
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 infovis.column.BasicColumn |
---|
addValue, addValueOrNull, firstValidRow, getClientProperty, getFormat, getMaxIndex, getMetadata, getMinIndex, getName, isEmpty, isInternal, iterator, lastValidRow, setFormat, setName, setValueOrNullAt, toString |
Methods inherited from class infovis.column.AbstractColumn |
---|
addChangeListener, computeValueMap, computeValueMap, equalObj, equals, getLastModifiedRow |
Methods inherited from class infovis.utils.ChangeManager |
---|
disableNotify, enableNotify, getModCount, removeChangeListener |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface infovis.Column |
---|
disableNotify, enableNotify, removeChangeListener |
Constructor Detail |
---|
public BasicObjectColumn(String name)
name
- the column name.public BasicObjectColumn(String name, int reserve)
name
- the column name.reserve
- the initial capacity.Method Detail |
---|
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
clear
in class BasicColumn
public boolean compareValues(Column c)
compareValues
in class AbstractColumn
c
- the column to compare values from
true
if the values match, false
otherwisepublic Object getObjectAt(int index)
null
if
it is undefined or invalid.
index
- the index.
null
if
it is undefined or invalid.public void setObjectAt(int index, Object element)
index
- index of element to replace.element
- element to be stored at the specified position.public void setValueUndefined(int index, boolean undef)
index
- the indexundef
- true if the value should be undefined,
false otherwise.public abstract Object definedValue()
public boolean isValueUndefined(int index)
index
- the index
public boolean hasUndefinedValue()
true
if the columns contains
undefined values, false
otherwise.
true
if the columns contains
undefined values, false
otherwise.public final void setExtend(int index, Object element)
index
- index of element to replace.element
- element to be stored at the specified position.public void add(Object element)
element
- the element.public void remove(int row)
row
- the rowpublic int indexOf(Object o)
o
- the object
public boolean remove(Object o)
o
- the object to remove
public void fill(Object val)
val
- the valuepublic Object parse(String v) throws ParseException
v
- the string representation of the value
ParseException
- if the value cannot be parsedpublic String format(Object v)
v
- the value
public String getValueAt(int i)
null
if
the element is undefined. The representation is
generated by the current format.
i
- index of element representation to return.
null
if the element is undefined.public void setValueAt(int i, String v) 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.
i
- index of element to replace.v
- element to be stored at the specified position.
ParseException
- if the specified string cannot be parsed.public int compare(Object s1, Object s2)
s1
- first objects2
- second object
public Comparator getOrder()
public void setOrder(Comparator order)
order
- The order to setpublic Class getValueClass()
getValueClass
in interface Column
getValueClass
in class BasicColumn
public int compare(int row1, int row2)
compare
in interface IntComparator
compare
in class BasicColumn
public void setSize(int newSize)
0
items
are added to the end of the column. If the new sizeColumn is
less than the current sizeColumn, all components at index
newSize
and greater are discarded.
setSize
in interface Column
setSize
in class BasicColumn
newSize
- the new sizeColumn of this column.public int capacity()
public void ensureCapacity(int minCapacity)
minCapacity
- the desired minimum capacity.public int size()
public ArrayList getValueReference()
ArrayList
for this column (USE WITH CARE).
ArrayList
for this column.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |