Package lumis.doui.source
Class TabularData
- java.lang.Object
-
- lumis.doui.source.TabularData
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.util.Map<java.lang.String,java.lang.Object>
,ISourceData
@StableMinor(version="16.0", sinceVersion="4.0") public class TabularData extends java.lang.Object implements ISourceData, java.lang.Cloneable
Represents tabular data, through a set of ISourceData elements- Since:
- 4.0.0
- Version:
- $Revision: 25809 $ $Date: 2023-07-04 15:23:22 -0300 (Tue, 04 Jul 2023) $
-
-
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(java.lang.Object key)
Delegates the call to the first row, or returns false if there is no first row.boolean
containsValue(java.lang.Object value)
Delegates the call to the first row, or returns false if there is no first row.java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>>
entrySet()
Delegates the call to the first row, or returns an empty set if there is no first row.java.lang.Object
get(java.lang.Object key)
Delegates the call to the first row, or returns null if there is no first row.<T> T
get(java.lang.Object key, java.lang.Class<T> expectedClass)
Delegates the call to the first row, or returns null if there is no first row.java.util.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.java.util.Set<java.lang.String>
keySet()
Delegates the call to the first row, or returns an empty set if there is no first row.java.lang.Object
put(java.lang.String key, java.lang.Object value)
Delegates the call to the first row.void
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> t)
Delegates the call to the first row.java.lang.Object
remove(java.lang.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(java.util.Comparator<ISourceData> comparator)
java.lang.String
toString()
java.util.Collection<java.lang.Object>
values()
Delegates the call to the first row, or returns an empty set if there is no first row.
-
-
-
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 java.util.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(java.util.Comparator<ISourceData> comparator)
-
get
public <T> T get(java.lang.Object key, java.lang.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.- Specified by:
clear
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsKey
public boolean containsKey(java.lang.Object key)
Delegates the call to the first row, or returns false if there is no first row.- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsValue
public boolean containsValue(java.lang.Object value)
Delegates the call to the first row, or returns false if there is no first row.- Specified by:
containsValue
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
Delegates the call to the first row, or returns an empty set if there is no first row.- Specified by:
entrySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
get
public java.lang.Object get(java.lang.Object key)
Delegates the call to the first row, or returns null if there is no first row.- Specified by:
get
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
isEmpty
public boolean isEmpty()
Returns true if this tabular data has no row, false otherwise.- Specified by:
isEmpty
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
keySet
public java.util.Set<java.lang.String> keySet()
Delegates the call to the first row, or returns an empty set if there is no first row.- Specified by:
keySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
put
public java.lang.Object put(java.lang.String key, java.lang.Object value)
Delegates the call to the first row. If there is no row one is created.- Specified by:
put
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> t)
Delegates the call to the first row. If there is no row one is created.- Specified by:
putAll
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
remove
public java.lang.Object remove(java.lang.Object key)
Delegates the call to the first row or returns null if there is no row.- Specified by:
remove
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
size
public int size()
Returns the number of rows in this tabular data.- Specified by:
size
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
values
public java.util.Collection<java.lang.Object> values()
Delegates the call to the first row, or returns an empty set if there is no first row.- Specified by:
values
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
clone
public TabularData clone()
- Overrides:
clone
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-