Package dk.vajhoej.model.core
Class Model
- java.lang.Object
-
- dk.vajhoej.model.Versioned
-
- dk.vajhoej.model.PersistableBase
-
- dk.vajhoej.model.core.Model
-
- All Implemented Interfaces:
Duplicatable,Persistable,SeparatePersistable,java.io.Serializable,java.lang.Cloneable
public class Model extends PersistableBase implements SeparatePersistable, Duplicatable, java.io.Serializable
Class Model represents an architectural model.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBox(Box box)Add box.voidaddConnection(Connection con)Add connection.voidaddPicture(Picture pic)Add picture.Modelduplicate()Duplicate object.booleanequals(java.lang.Object o)NameValuePairListgetAttributes()Get all single value fields.java.util.List<Box>getBoxes()Get boxes.java.util.List<java.util.List<Persistable>>getChildren()Get all multi value fields.java.util.List<Connection>getConnections()Get connections.java.lang.StringgetId()Get id identifying object.java.lang.StringgetName()Get name.java.util.List<Picture>getPictures()Get pictures.java.lang.StringgetType()Get type (XML element name / database table name not Java class name).inthashCode()voidremoveBox(Box box)Remove box.voidremoveConnection(Connection con)Remove connection.voidremovePicture(Picture pic)Remove picture.voidsetAttributes(NameValuePairList attr)Set all single value fields.voidsetChildren(java.util.List<java.util.List<Persistable>> childs)Set all multi value fields.voidsetName(java.lang.String name)Set name.java.lang.StringtoString()-
Methods inherited from class dk.vajhoej.model.PersistableBase
getStore, setStore
-
Methods inherited from class dk.vajhoej.model.Versioned
clone, getVersion, setVersion
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface dk.vajhoej.model.SeparatePersistable
getStore, setStore
-
-
-
-
Constructor Detail
-
Model
public Model()
Create instance of Model.
-
Model
public Model(java.lang.String name, Version version)Create instance of Model.- Parameters:
name- nameversion- version
-
-
Method Detail
-
getName
public java.lang.String getName()
Get name.- Returns:
- name
-
setName
public void setName(java.lang.String name)
Set name.- Parameters:
name- name
-
getBoxes
public java.util.List<Box> getBoxes()
Get boxes.- Returns:
- unmodifiable list of boxes
-
addBox
public void addBox(Box box)
Add box.- Parameters:
box- box
-
removeBox
public void removeBox(Box box)
Remove box.- Parameters:
box- box
-
getConnections
public java.util.List<Connection> getConnections()
Get connections.- Returns:
- unmodifiable list of connections
-
addConnection
public void addConnection(Connection con)
Add connection.- Parameters:
con- connection
-
removeConnection
public void removeConnection(Connection con)
Remove connection.- Parameters:
con- connection
-
getPictures
public java.util.List<Picture> getPictures()
Get pictures.- Returns:
- unmodifiable list of pictures
-
addPicture
public void addPicture(Picture pic)
Add picture.- Parameters:
pic- picture
-
removePicture
public void removePicture(Picture pic)
Remove picture.- Parameters:
pic- picture
-
duplicate
public Model duplicate()
Description copied from interface:DuplicatableDuplicate object. The result will have the same characteristics as the original but may not be equal to it.- Specified by:
duplicatein interfaceDuplicatable- Returns:
- duplicate
-
getId
public java.lang.String getId()
Description copied from interface:PersistableGet id identifying object.- Specified by:
getIdin interfacePersistable- Returns:
- id
-
getType
public java.lang.String getType()
Description copied from interface:PersistableGet type (XML element name / database table name not Java class name).- Specified by:
getTypein interfacePersistable- Returns:
- type
-
getAttributes
public NameValuePairList getAttributes()
Description copied from interface:PersistableGet all single value fields.- Specified by:
getAttributesin interfacePersistable- Returns:
- name value pair list
-
getChildren
public java.util.List<java.util.List<Persistable>> getChildren()
Description copied from interface:PersistableGet all multi value fields.- Specified by:
getChildrenin interfacePersistable- Returns:
- list of list of persistable objects
-
setAttributes
public void setAttributes(NameValuePairList attr) throws ModelException
Description copied from interface:PersistableSet all single value fields.- Specified by:
setAttributesin interfacePersistable- Parameters:
attr- value pair list- Throws:
ModelException- if problems
-
setChildren
public void setChildren(java.util.List<java.util.List<Persistable>> childs)
Description copied from interface:PersistableSet all multi value fields.- Specified by:
setChildrenin interfacePersistable- Parameters:
childs- list of list of persistable objects
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-