classes

## Class CpsEdge

- java.lang.Object
- - classes.CpsEdge

    public class CpsEdge
    extends java.lang.Object

The class "CpsEdge" represents the connections on the GUI. Each connection contains a max. capacity, a flow, a status (isWorking), tags (for internal use of electricity flow), source and destination

Author:
  Gruppe14

### Constructor Summary

Constructors
Constructor and Description
`CpsEdge(AbstractCpsObject a, AbstractCpsObject b)` Constructor without max. capacity (by default as 100)
`CpsEdge(AbstractCpsObject a, AbstractCpsObject b, float maxCap)` Constructor with a user-defined max. capacity

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addTag(int tag)` Add a new tag to the ArrayList.
`void` `calculateState(boolean simMode)` Calculates the state of the edge (see description of isWorking).
`AbstractCpsObject` `getA()` Getter for the Source.
`AbstractCpsObject` `getB()` Getter for the destination.
`float` `getCapacity()` Getter for the max. capacity
`float` `getFlow()` Getter fot the current flow.
`boolean` `getState()` Getter for the status.
`java.util.ArrayList<java.lang.Integer>` `getTags()` Getter for the ArrayList of tags.
`void` `setA(AbstractCpsObject a)` Set the Source to a new one.
`void` `setB(AbstractCpsObject b)` Set the Destination to a new one.
`void` `setCapacity(float cap)` Setter for the max. capacity
`void` `setFlow(float flow)` Set the flow into a new one.
`void` `setState(boolean state)` Set the state manually to a new one.
`void` `setTags(java.util.ArrayList<java.lang.Integer> tags)` set the tags into a new set of tags.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CpsEdge

    public CpsEdge(AbstractCpsObject a,
                   AbstractCpsObject b)

Constructor without max. capacity (by default as 100)

Parameters:
  `a` - Source
  `b` - Destination

#### CpsEdge

    public CpsEdge(AbstractCpsObject a,
                   AbstractCpsObject b,
                   float maxCap)

Constructor with a user-defined max. capacity

Parameters:
  `a` - Source
  `b` - Destination
  `maxCap` - Maximum Capacity

### Method Detail

#### getCapacity

    public float getCapacity()

Getter for the max. capacity

Returns:
  the capacity

#### setCapacity

    public void setCapacity(float cap)

Setter for the max. capacity

Parameters:
  `cap` - the Capacity to set

#### getFlow

    public float getFlow()

Getter fot the current flow.

Returns:
  the flow

#### setFlow

    public void setFlow(float flow)

Set the flow into a new one.

Parameters:
  `flow` - the flow to set

#### calculateState

    public void calculateState(boolean simMode)

Calculates the state of the edge (see description of isWorking).

Parameters:
  `simMode` - Simulation Mode

#### getA

    public AbstractCpsObject getA()

Getter for the Source.

Returns:
  the a

#### setA

    public void setA(AbstractCpsObject a)

Set the Source to a new one.

Parameters:
  `a` - the a to set

#### getB

    public AbstractCpsObject getB()

Getter for the destination.

Returns:
  the b

#### setB

    public void setB(AbstractCpsObject b)

Set the Destination to a new one.

Parameters:
  `b` - the b to set

#### setState

    public void setState(boolean state)

Set the state manually to a new one.

Parameters:
  `state` - the state

#### getState

    public boolean getState()

Getter for the status.

Returns:
  the state

#### setTags

    public void setTags(java.util.ArrayList<java.lang.Integer> tags)

set the tags into a new set of tags.

Parameters:
  `tags` - tags for this edge

#### getTags

    public java.util.ArrayList<java.lang.Integer> getTags()

Getter for the ArrayList of tags.

Returns:
  tags tags for this edge

#### addTag

    public void addTag(int tag)

Add a new tag to the ArrayList.

Parameters:
  `tag` - tag for the ArrayList