pl.edu.agh.cast.model.base
Class DataSet

java.lang.Object
  extended by pl.edu.agh.cast.model.mapper.AbstractMappable
      extended by pl.edu.agh.cast.model.base.DataSet
All Implemented Interfaces:
Serializable, Cloneable, IDataProvider, IDataSet, Mappable

@Mapping
public class DataSet
extends AbstractMappable
implements IDataSet

The default implementation of the IDataSet interface. It is mapped to the base model.

Author:
AGH CAST Team
See Also:
IDataSet,

The data set is mapped to the base model., Serialized Form


Field Summary
protected  IModel model
          The model which this data set belongs to.
protected  List<Relation> relations
          List of relations
 
Fields inherited from class pl.edu.agh.cast.model.mapper.AbstractMappable
id
 
Constructor Summary
DataSet()
          Constructor needed by the mapping mechanism.
DataSet(String id)
          The default constructor.
DataSet(String id, IModel model)
          The parametrized constructor.
 
Method Summary
 void addRelation(IRelation relation)
          Add relation to this data set.
 boolean equals(Object other)
          
 Collection<IEntity> getEntities()
          Return all entities present in this data set.
 IModel getModel()
          Model getter.
 String getModelExtensionId()
          Returns the ID of the model extension (see pl.edu.agh.cast.model Extension Point) which defines this data set.
 List<IRelation> getRelations()
          Return relations present in this data set.
 int hashCode()
          
 void setModel(IModel newModel)
          Model setter.
 void setModelExtensionId(String id)
          Sets the ID of the model extension (see pl.edu.agh.cast.model Extension Point) which defines this data set.
 void setRelations(List<IRelation> relations)
          Sets the relations of this data set.
 String toString()
          
 
Methods inherited from class pl.edu.agh.cast.model.mapper.AbstractMappable
clone, getAttribute, getAttributeNames, getAttributeType, getId, getMid, getType, setAttribute, setId, setMid
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface pl.edu.agh.cast.model.base.IDataSet
getId, setId
 
Methods inherited from interface pl.edu.agh.cast.model.mapper.Mappable
clone, getAttribute, getAttributeNames, getAttributeType, getMid, getType, setAttribute, setMid
 

Field Detail

relations

protected List<Relation> relations
List of relations


model

protected IModel model
The model which this data set belongs to.

Constructor Detail

DataSet

public DataSet()
Constructor needed by the mapping mechanism.


DataSet

public DataSet(String id)
The default constructor.

Parameters:
id - The id of the data set.

DataSet

public DataSet(String id,
               IModel model)
The parametrized constructor.

Parameters:
id - The id of the data set.
model - The model which this data set belongs to.
Method Detail

getModel

@MapLink(name="modelDataSet")
public IModel getModel()
Description copied from interface: IDataSet
Model getter.

Specified by:
getModel in interface IDataSet
Returns:
the model

setModel

public void setModel(IModel newModel)
Description copied from interface: IDataSet
Model setter.

Specified by:
setModel in interface IDataSet
Parameters:
newModel - the model to set

getRelations

@MapLink(name="dataSetRelations",
         direction=DST)
public List<IRelation> getRelations()
Return relations present in this data set.

Specified by:
getRelations in interface IDataSet
Returns:
List of relations
See Also:
IDataSet.getRelations()

setRelations

public void setRelations(List<IRelation> relations)
Sets the relations of this data set.

Specified by:
setRelations in interface IDataSet
Parameters:
relations - List of relations to set
See Also:
IDataSet.setRelations(java.util.List)

addRelation

public void addRelation(IRelation relation)
Add relation to this data set. Automatically adds this data set to the relation's data set collection.

Specified by:
addRelation in interface IDataSet
Parameters:
relation - Relation to add.
See Also:
IDataSet.addRelation(pl.edu.agh.cast.model.base.IRelation)

getEntities

public Collection<IEntity> getEntities()
Return all entities present in this data set.

Specified by:
getEntities in interface IDataSet
Returns:
Collection of entities.
See Also:
IDataSet.getEntities()

toString

public String toString()

Overrides:
toString in class AbstractMappable
See Also:
AbstractMappable.toString()

getModelExtensionId

@MapAttribute(typeName="ModelExtensionId")
public String getModelExtensionId()
Returns the ID of the model extension (see pl.edu.agh.cast.model Extension Point) which defines this data set.

Specified by:
getModelExtensionId in interface IDataSet
Returns:
The ID of the model extension.
See Also:
IDataSet.getModelExtensionId()

setModelExtensionId

public void setModelExtensionId(String id)
Sets the ID of the model extension (see pl.edu.agh.cast.model Extension Point) which defines this data set.

Specified by:
setModelExtensionId in interface IDataSet
Parameters:
id - The ID of the model extension
See Also:
IDataSet.setModelExtensionId(java.lang.String)

equals

public boolean equals(Object other)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.