Package classycle.graph

# Class StrongComponent

java.lang.Object
classycle.graph.Vertex
classycle.graph.StrongComponent

All Implemented Interfaces:
  `Comparable<Vertex>`

public class StrongComponent extends Vertex
A strong component is a subgraph of a directed graph where every two vertices are mutually reachable.

Author:
  Franz-Josef Elmer

## Constructor Summary

Constructors
Constructor
Description
`StrongComponent()`
Default constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`addVertex(AtomicVertex vertex)`
Adds the specified vertex to this strong component.
`void`
`calculateAttributes()`
Calculates all graph properties of this component.
`int`
`getLongestWalk()`
`int`
`getNumberOfVertices()`
Returns the number of vertices building this strong component.
`AtomicVertex`
`getVertex(int index)`
Returns the vertex of the specified index.
`boolean`
`isActive()`
`void`
`reset()`
Reset this component.
`void`
`setActive(boolean active)`
`void`
`setLongestWalk(int longestWalk)`
`String`
`toString()`
Returns `toString()` of the attributes and the number of incoming and outgoing arcs.

### Methods inherited from class classycle.graph.Vertex

`addIncomingArcTo, addOutgoingArcTo, compareTo, getAttributes, getHeadVertex, getNumberOfIncomingArcs, getNumberOfOutgoingArcs, getTailVertex, isVisited, visit`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### StrongComponent

public StrongComponent()
Default constructor. The `Attributes` of a strong component will a `null` pointer.

## Method Details

### getNumberOfVertices

public int getNumberOfVertices()
Returns the number of vertices building this strong component.

### getVertex

public AtomicVertex getVertex(int index)
Returns the vertex of the specified index.

### addVertex

public void addVertex(AtomicVertex vertex)
Adds the specified vertex to this strong component. Note, that added vertices are inserted at index 0 of the list of vertices.

### calculateAttributes

public void calculateAttributes()
Calculates all graph properties of this component. These properties can be obtained from `getAttributes` casted as `GraphAttributes`.

### reset

public void reset()
Reset this component. Calls reset of the superclass. Sets the activity flag to false and the longest walk to -1.

Overrides:
  `reset` in class `Vertex`

### isActive

public boolean isActive()

### setActive

public void setActive(boolean active)

### getLongestWalk

public int getLongestWalk()

### setLongestWalk

public void setLongestWalk(int longestWalk)

### toString

public String toString()
Description copied from class: `Vertex`
Returns `toString()` of the attributes and the number of incoming and outgoing arcs.

Overrides:
  `toString` in class `Vertex`