Package lumis.doui.source
Class TabularData
- java.lang.Object
-
- lumis.doui.source.TabularData
-
- All Implemented Interfaces:
Cloneable
,Map<String,Object>
,ISourceData
@StableMinor(version="14.0", sinceVersion="4.0") public class TabularData extends Object implements ISourceData, Cloneable
Represents tabular data, through a set of ISourceData elements- Since:
- 4.0.0
- Version:
- $Revision: 24476 $ $Date: 2021-04-28 11:28:23 -0300 (Wed, 28 Apr 2021) $
-
-
Constructor Summary
Constructors Constructor Description TabularData()
Creates a new tabular data without any source association.TabularData(Source source)
Creates a new tabular data associated with the given source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ISourceData
addRow()
Adds a row in this tabular data.void
clear()
Removes all rows in this tabular data.TabularData
clone()
boolean
containsKey(Object key)
Delegates the call to the first row, or returns false if there is no first row.boolean
containsValue(Object value)
Delegates the call to the first row, or returns false if there is no first row.Set<Map.Entry<String,Object>>
entrySet()
Delegates the call to the first row, or returns an empty set if there is no first row.Object
get(Object key)
Delegates the call to the first row, or returns null if there is no first row.<T> T
get(Object key, Class<T> expectedClass)
Delegates the call to the first row, or returns null if there is no first row.List<ISourceData>
getRows()
Returns the rows in this tabular data.int
getTotalRows()
boolean
isEmpty()
Returns true if this tabular data has no row, false otherwise.Set<String>
keySet()
Delegates the call to the first row, or returns an empty set if there is no first row.Object
put(String key, Object value)
Delegates the call to the first row.void
putAll(Map<? extends String,? extends Object> t)
Delegates the call to the first row.Object
remove(Object key)
Delegates the call to the first row or returns null if there is no row.void
setTotalRows(int totalRows)
int
size()
Returns the number of rows in this tabular data.void
sort(Comparator<ISourceData> comparator)
String
toString()
Collection<Object>
values()
Delegates the call to the first row, or returns an empty set if there is no first row.-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
TabularData
public TabularData()
Creates a new tabular data without any source association.- Since:
- 4.0.4
-
TabularData
public TabularData(Source source)
Creates a new tabular data associated with the given source.- Parameters:
source
- the source.- Since:
- 4.0.4
-
-
Method Detail
-
getRows
public List<ISourceData> getRows()
Returns the rows in this tabular data. To add a row, use the methodaddRow()
instead of calling directly the list add method.- Returns:
- the rows in this tabular data.
- Since:
- 4.0.4
-
addRow
public ISourceData addRow()
Adds a row in this tabular data.- Returns:
- the added row.
- Since:
- 4.0.4
-
getTotalRows
public int getTotalRows()
-
setTotalRows
public void setTotalRows(int totalRows)
-
sort
public void sort(Comparator<ISourceData> comparator)
-
get
public <T> T get(Object key, Class<T> expectedClass)
Delegates the call to the first row, or returns null if there is no first row.- Specified by:
get
in interfaceISourceData
- Type Parameters:
T
- the expected class.- Parameters:
key
- the data entry key.expectedClass
- the expected class.- Returns:
- the converted data value.
-
clear
public void clear()
Removes all rows in this tabular data.
-
containsKey
public boolean containsKey(Object key)
Delegates the call to the first row, or returns false if there is no first row.- Specified by:
containsKey
in interfaceMap<String,Object>
-
containsValue
public boolean containsValue(Object value)
Delegates the call to the first row, or returns false if there is no first row.- Specified by:
containsValue
in interfaceMap<String,Object>
-
entrySet
public Set<Map.Entry<String,Object>> entrySet()
Delegates the call to the first row, or returns an empty set if there is no first row.
-
get
public Object get(Object key)
Delegates the call to the first row, or returns null if there is no first row.
-
isEmpty
public boolean isEmpty()
Returns true if this tabular data has no row, false otherwise.
-
keySet
public Set<String> keySet()
Delegates the call to the first row, or returns an empty set if there is no first row.
-
put
public Object put(String key, Object value)
Delegates the call to the first row. If there is no row one is created.
-
putAll
public void putAll(Map<? extends String,? extends Object> t)
Delegates the call to the first row. If there is no row one is created.
-
remove
public Object remove(Object key)
Delegates the call to the first row or returns null if there is no row.
-
size
public int size()
Returns the number of rows in this tabular data.
-
values
public Collection<Object> values()
Delegates the call to the first row, or returns an empty set if there is no first row.
-
clone
public TabularData clone()
-
-