discovery.model
Class ConnectionModel

java.lang.Object
  extended by discovery.model.ConnectionModel
All Implemented Interfaces:
java.io.Serializable

public class ConnectionModel
extends java.lang.Object
implements java.io.Serializable

This class represents a connection between two components in the model.

See Also:
Serialized Form

Field Summary
static int COMPOSITION
          Static integer representing a composition connection type in a connection between tasks.
static int FLOW
          Static integer representing a flow connection type in a connection.
static int GENERALISATION
          Static integer representing a generalisation connection type in a connection between tasks.
static int OWNERSHIP
          Static integer representing an ownership connection type in a connection.
static int PARTICIPATION
          Static integer representing a participation connection type in a connection.
 
Constructor Summary
ConnectionModel()
          Creates an empty connection with no components to connect or a connection type.
ConnectionModel(int c1, int c2, int t)
          Creates a connection between components c1 and c2, of type t.
ConnectionModel(int id, int c1, int c2, int t)
          Creates the connection with ID number id between components c1 and c2, of type t.
 
Method Summary
 java.lang.Integer getComponent1()
          Accessor method to get the first component (ie.
 java.lang.Integer getComponent2()
          Accessor method to get the second component (ie.
 java.lang.Integer getID()
          Accessor method to get the unique ID number of this connection.
 java.lang.Integer getRelation()
          Accessor method to get the type of relationship of this connection.
 void setComponent1(java.lang.Integer c1)
          Mutator method to set the first (ie.
 void setComponent2(java.lang.Integer c2)
          Mutator method to set the second (ie.
 void setRelation(java.lang.Integer t)
          Mutator method to set the type of this connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPOSITION

public static final int COMPOSITION
Static integer representing a composition connection type in a connection between tasks.

See Also:
Constant Field Values

GENERALISATION

public static final int GENERALISATION
Static integer representing a generalisation connection type in a connection between tasks.

See Also:
Constant Field Values

PARTICIPATION

public static final int PARTICIPATION
Static integer representing a participation connection type in a connection.

See Also:
Constant Field Values

OWNERSHIP

public static final int OWNERSHIP
Static integer representing an ownership connection type in a connection.

See Also:
Constant Field Values

FLOW

public static final int FLOW
Static integer representing a flow connection type in a connection.

See Also:
Constant Field Values
Constructor Detail

ConnectionModel

public ConnectionModel()
Creates an empty connection with no components to connect or a connection type.


ConnectionModel

public ConnectionModel(int c1,
                       int c2,
                       int t)
Creates a connection between components c1 and c2, of type t.

Parameters:
c1 - the source component of the connection
c2 - the destination component of the connection
t - the type of connection

ConnectionModel

public ConnectionModel(int id,
                       int c1,
                       int c2,
                       int t)
Creates the connection with ID number id between components c1 and c2, of type t. Not recommended to use unless rebuilding a ConnectionModel object from the database, as the ID number must be supplied and is not uniquely generated.

Parameters:
id - the connection's ID number
c1 - the source component of the connection
c2 - the destination component of the connection
t - the type of connection
Method Detail

getComponent1

public java.lang.Integer getComponent1()
Accessor method to get the first component (ie. the source) of this connection.

Returns:
the unique ID number of the source component in the connection

getComponent2

public java.lang.Integer getComponent2()
Accessor method to get the second component (ie. the destination) of this connection.

Returns:
the unique ID number of the destination component in the connection

getRelation

public java.lang.Integer getRelation()
Accessor method to get the type of relationship of this connection.

Returns:
an int representing the type of relationship that this connection is

getID

public java.lang.Integer getID()
Accessor method to get the unique ID number of this connection.

Returns:
the unique ID number of this connection

setComponent1

public void setComponent1(java.lang.Integer c1)
Mutator method to set the first (ie. the source) component in this connection.

Parameters:
c1 - the unique ID number of the first (ie. the source) component in this connection

setComponent2

public void setComponent2(java.lang.Integer c2)
Mutator method to set the second (ie. the destination) component in this connection.

Parameters:
c2 - the unique ID number of the second (ie. the destination) component in this connection

setRelation

public void setRelation(java.lang.Integer t)
Mutator method to set the type of this connection.

Parameters:
t - the ConnectionModel constant representing the type of the connection