dk.vajhoej.model.core
Class ConnectionPalette

java.lang.Object
  extended by dk.vajhoej.model.Versioned
      extended by dk.vajhoej.model.PersistableBase
          extended by dk.vajhoej.model.PaletteBase
              extended by dk.vajhoej.model.core.ConnectionPalette
All Implemented Interfaces:
Duplicatable, Persistable, SeparatePersistable, java.io.Serializable, java.lang.Cloneable

public class ConnectionPalette
extends PaletteBase
implements SeparatePersistable, Duplicatable, java.io.Serializable

Class ConnectionPalette represents a palette of connections between boxes.

See Also:
Serialized Form

Constructor Summary
ConnectionPalette()
          Create instance of ConnectionPalette.
ConnectionPalette(java.lang.String name, Version version)
          Create instance of ConnectionPalette.
 
Method Summary
 void addConnection(Connection con)
          Add connection.
 ConnectionPalette duplicate()
          Duplicate object.
 boolean equals(java.lang.Object o)
           
 NameValuePairList getAttributes()
          Get all single value fields.
 java.util.List<java.util.List<Persistable>> getChildren()
          Get all multi value fields.
 java.util.List<Connection> getConnections()
          Get connections.
 java.lang.String getId()
          Get id identifying object.
 java.lang.String getName()
          Get name.
 java.lang.String getType()
          Get type (XML element name / database table name not Java class name).
 int hashCode()
           
 void removeConnection(Connection con)
          Remove connection.
 void setAttributes(NameValuePairList attr)
          Set all single value fields.
 void setChildren(java.util.List<java.util.List<Persistable>> childs)
          Set all multi value fields.
 java.lang.String toString()
           
 
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

ConnectionPalette

public ConnectionPalette()
Create instance of ConnectionPalette.


ConnectionPalette

public ConnectionPalette(java.lang.String name,
                         Version version)
Create instance of ConnectionPalette.

Parameters:
name - name
version - version
Method Detail

getName

public java.lang.String getName()
Get name.

Specified by:
getName in class PaletteBase
Returns:
name

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

duplicate

public ConnectionPalette duplicate()
Description copied from interface: Duplicatable
Duplicate object. The result will have the same characteristics as the original but may not be equal to it.

Specified by:
duplicate in interface Duplicatable
Returns:
duplicate

getId

public java.lang.String getId()
Description copied from interface: Persistable
Get id identifying object.

Specified by:
getId in interface Persistable
Returns:
id

getType

public java.lang.String getType()
Description copied from interface: Persistable
Get type (XML element name / database table name not Java class name).

Specified by:
getType in interface Persistable
Returns:
type

getAttributes

public NameValuePairList getAttributes()
Description copied from interface: Persistable
Get all single value fields.

Specified by:
getAttributes in interface Persistable
Returns:
name value pair list

getChildren

public java.util.List<java.util.List<Persistable>> getChildren()
Description copied from interface: Persistable
Get all multi value fields.

Specified by:
getChildren in interface Persistable
Returns:
list of list of persistable objects

setAttributes

public void setAttributes(NameValuePairList attr)
                   throws ModelException
Description copied from interface: Persistable
Set all single value fields.

Specified by:
setAttributes in interface Persistable
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: Persistable
Set all multi value fields.

Specified by:
setChildren in interface Persistable
Parameters:
childs - list of list of persistable objects

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object