cl.cromer.estructuras

## Class Grafo.Edge<T>

- java.lang.Object
- - cl.cromer.estructuras.Grafo.Edge<T>

Type Parameters:
  `T` - Generic object

Enclosing class:
  Grafo

    public static final class Grafo.Edge<T>
    extends java.lang.Object

A directed, weighted edge in a graph

Version:
  $Revision$
Author:
  Scott.Stark@jboss.org

### Field Summary

Fields
`private int` `cost`
`private Grafo.Vertex<T>` `from`
`private boolean` `mark`
`private Grafo.Vertex<T>` `to`

### Constructor Summary

Constructors
Constructor and Description
`Edge(Grafo.Vertex<T> from, Grafo.Vertex<T> to)` Create a zero cost edge between from and to
`Edge(Grafo.Vertex<T> from, Grafo.Vertex<T> to, int cost)` Create an edge between from and to with the given cost.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clearMark()` Clear the edge mark flag
`int` `getCost()` Get the cost of the edge
`Grafo.Vertex<T>` `getFrom()` Get the starting vertex
`Grafo.Vertex<T>` `getTo()` Get the ending vertex
`boolean` `isMarked()` Get the edge mark flag
`void` `mark()` Set the mark flag of the edge
`java.lang.String` `toString()` String rep of edge

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

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

### Field Detail

#### from

    private Grafo.Vertex<T> from

#### to

    private Grafo.Vertex<T> to

#### cost

    private int cost

#### mark

    private boolean mark

### Constructor Detail

#### Edge

    public Edge(Grafo.Vertex<T> from,
                Grafo.Vertex<T> to)

Create a zero cost edge between from and to

Parameters:
  `from` - the starting vertex
  `to` - the ending vertex

#### Edge

    public Edge(Grafo.Vertex<T> from,
                Grafo.Vertex<T> to,
                int cost)

Create an edge between from and to with the given cost.

Parameters:
  `from` - the starting vertex
  `to` - the ending vertex
  `cost` - the cost of the edge

### Method Detail

#### getTo

    public Grafo.Vertex<T> getTo()

Get the ending vertex

Returns:
  ending vertex

#### getFrom

    public Grafo.Vertex<T> getFrom()

Get the starting vertex

Returns:
  starting vertex

#### getCost

    public int getCost()

Get the cost of the edge

Returns:
  cost of the edge

#### mark

    public void mark()

Set the mark flag of the edge

#### clearMark

    public void clearMark()

Clear the edge mark flag

#### isMarked

    public boolean isMarked()

Get the edge mark flag

Returns:
  edge mark flag

#### toString

    public java.lang.String toString()

String rep of edge

Overrides:
  `toString` in class `java.lang.Object`
Returns:
  string rep with from/to vertex names and cost