net.sf.myra.framework
Class Vertex<V extends Info>

java.lang.Object
  extended by net.sf.myra.framework.Graph.Element
      extended by net.sf.myra.framework.Vertex<V>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Vertex<?>>, Weighable

public class Vertex<V extends Info>
extends Graph.Element
implements java.lang.Comparable<Vertex<?>>, java.lang.Cloneable, java.io.Serializable

This class represents a vertex of the problem construction graph.

Version:
$Revision$ $Date:: $
Author:
Fernando Esteban Barril Otero
See Also:
Serialized Form

Constructor Summary
Vertex(java.lang.String label)
          Default constructor.
 
Method Summary
 Vertex<V> clone()
          Creates and returns a copy of this weighted component instance.
 int compareTo(Vertex<?> o)
           
 boolean equals(java.lang.Object v)
           
 boolean equals(Vertex<?> v)
          Compares the specified vertex with this vertex for equality.
 V getInfo()
          Returns the vertex info object.
 java.lang.String getLabel()
          Returns the vertex label.
 int hashCode()
           
 void setInfo(V v)
          Sets the vertex info.
 void setLabel(java.lang.String label)
          Sets the vertex label.
 java.lang.String toString()
           
 
Methods inherited from class net.sf.myra.framework.Graph.Element
getHeuristicValue, getHeuristicValue, getPheromone, getPheromone, levels, setHeuristicValue, setHeuristicValue, setPheromone, setPheromone
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vertex

public Vertex(java.lang.String label)
Default constructor.

Parameters:
label - the vertex label.
Method Detail

getLabel

public java.lang.String getLabel()
Returns the vertex label.

Returns:
the vertex label.

setLabel

public void setLabel(java.lang.String label)
Sets the vertex label.

Parameters:
label - the label to set.

equals

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

equals

public boolean equals(Vertex<?> v)
Compares the specified vertex with this vertex for equality. Returns true if the two instances have the same label.

Parameters:
v - the vertex to be compared for equality with this vertex.
Returns:
true if the specified vertex is equal to this vertex; false otherwise.

getInfo

public V getInfo()
Returns the vertex info object.

Returns:
the vertex info object.

setInfo

public void setInfo(V v)
Sets the vertex info.

Parameters:
v - the info object.

hashCode

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

toString

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

compareTo

public int compareTo(Vertex<?> o)
Specified by:
compareTo in interface java.lang.Comparable<Vertex<?>>

clone

public Vertex<V> clone()
Description copied from class: Graph.Element
Creates and returns a copy of this weighted component instance.

Overrides:
clone in class Graph.Element
Returns:
a copy of this weighted component instance.


Copyright © 2013. All Rights Reserved.