lumis.doui.source
Class TabularData

Package class diagram package TabularData
java.lang.Object
  extended by lumis.doui.source.TabularData
All Implemented Interfaces:
Cloneable, Map<String,Object>, ISourceData

@StableMinor(version="6.2",
             sinceVersion="4.0")
public class TabularData
extends Object
implements ISourceData, Cloneable

Represents tabular data, through a set of ISourceData elements

Since:
4.0.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
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
 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)
           
 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, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

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 method addRow() 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 interface ISourceData
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 interface Map<String,Object>

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 interface Map<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 interface Map<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.

Specified by:
entrySet in interface Map<String,Object>

get

public Object get(Object key)
Delegates the call to the first row, or returns null if there is no first row.

Specified by:
get in interface Map<String,Object>

isEmpty

public boolean isEmpty()
Returns true if this tabular data has no row, false otherwise.

Specified by:
isEmpty in interface Map<String,Object>

keySet

public Set<String> keySet()
Delegates the call to the first row, or returns an empty set if there is no first row.

Specified by:
keySet in interface Map<String,Object>

put

public Object put(String key,
                  Object value)
Delegates the call to the first row. If there is no row one is created.

Specified by:
put in interface Map<String,Object>

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.

Specified by:
putAll in interface Map<String,Object>

remove

public Object remove(Object key)
Delegates the call to the first row or returns null if there is no row.

Specified by:
remove in interface Map<String,Object>

size

public int size()
Returns the number of rows in this tabular data.

Specified by:
size in interface Map<String,Object>

values

public Collection<Object> values()
Delegates the call to the first row, or returns an empty set if there is no first row.

Specified by:
values in interface Map<String,Object>

clone

public TabularData clone()
Overrides:
clone in class Object


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.