junitx.ddtunit.data
Class DataSet

java.lang.Object
  extended by junitx.ddtunit.data.DataSet
All Implemented Interfaces:
IDataSet
Direct Known Subclasses:
DDTDataRepository, TestClusterDataSet, TestDataSet, TestGroupDataSet

public abstract class DataSet
extends Object
implements IDataSet

Class containing all data objects used for executing a testclass.
The structure is a direct mapping of the xml resource structure of
class - method - testcase

Author:
jg

Field Summary
protected  TypedObjectMap objectMap
           
 
Constructor Summary
DataSet(String setId, IDataSet parent)
           
 
Method Summary
 boolean containsKey(String key)
          Check if provided key is instained in sub object map
 TypedObject findObject(String id)
           
 TypedObject findObject(String id, String type)
           
 IDataSet get(String id)
          Retrieve DataSet specified by id
 String getId()
          Retrieve id of DataSet
 TypedObject getObject(String id)
          Retrieve object entry from local object map
 TypedObject getObject(String id, String type)
          Retrieve object entry from local object map
 Iterator getSubDataIterator()
          Retrieve iterator over all keys provided by sub datasets
 Collection getSubDataValues()
          Retrieve iterator over all dataSets provided as subelements of this dataSet.
 void put(String id, IDataSet dataSet)
           
 void putObject(String id, TypedObject entry)
          add new entry to local object map
 int size()
          Retrieve number of sub datasets
 String toString()
          Return human readable description of object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

objectMap

protected TypedObjectMap objectMap
Constructor Detail

DataSet

public DataSet(String setId,
               IDataSet parent)
Parameters:
setId - specifies id for identification of dataset
Method Detail

putObject

public void putObject(String id,
                      TypedObject entry)
Description copied from interface: IDataSet
add new entry to local object map

Specified by:
putObject in interface IDataSet

getObject

public TypedObject getObject(String id,
                             String type)
Description copied from interface: IDataSet
Retrieve object entry from local object map

Specified by:
getObject in interface IDataSet
Returns:
selected object or null if not found

getObject

public TypedObject getObject(String id)
Description copied from interface: IDataSet
Retrieve object entry from local object map

Specified by:
getObject in interface IDataSet
Returns:
selected object

findObject

public TypedObject findObject(String id)
Specified by:
findObject in interface IDataSet

findObject

public TypedObject findObject(String id,
                              String type)
Specified by:
findObject in interface IDataSet

put

public void put(String id,
                IDataSet dataSet)
Specified by:
put in interface IDataSet

get

public IDataSet get(String id)
Description copied from interface: IDataSet
Retrieve DataSet specified by id

Specified by:
get in interface IDataSet
Returns:
dataset or null if nothing found

containsKey

public boolean containsKey(String key)
Description copied from interface: IDataSet
Check if provided key is instained in sub object map

Specified by:
containsKey in interface IDataSet
Returns:
true if found else false

getSubDataIterator

public Iterator getSubDataIterator()
Description copied from interface: IDataSet
Retrieve iterator over all keys provided by sub datasets

Specified by:
getSubDataIterator in interface IDataSet
Returns:
Iterator to process all keys

getSubDataValues

public Collection getSubDataValues()
Description copied from interface: IDataSet
Retrieve iterator over all dataSets provided as subelements of this dataSet.

Specified by:
getSubDataValues in interface IDataSet
Returns:
Iterator to process all subDataSets

size

public int size()
Description copied from interface: IDataSet
Retrieve number of sub datasets

Specified by:
size in interface IDataSet
Returns:
count of sub datasets

toString

public String toString()
Return human readable description of object.

Overrides:
toString in class Object
Returns:
Desciption of object.

getId

public String getId()
Description copied from interface: IDataSet
Retrieve id of DataSet

Specified by:
getId in interface IDataSet
Returns:
id of dataset


Copyright © 2004-2011. All Rights Reserved.