fr.inria.opengve.bridge.interfaces
Interface Arc<E>

All Superinterfaces:
Link<E>

public interface Arc<E>
extends Link<E>

As implied by its name, this interface models the mathematical arc abstraction, which can be viewed as a directed link. The Arc interface places additional stipulations, beyond those inherited from the Link interface, on the contracts of toArray, equals and hashCode methods. Such additional stipulations reflect the fact that link is directed from one specific vertex, called head, to the other, called tail. This interface also define additionnal methods to the Link interface that are specific to directed links.

The additional stipulations on the toArray methods is that the vertices are placed in the array returned by these methods as they were added, i.e. the head at position 0 and the tail at position 1.

The orientation of an arc also has consequences on the equals method. Let e1 and e2 two Arc objects. The method invocation e1.equals(e2) returns true only if e1.leavesFrom(e2.toArray()[0]) && e1.leadsTo(e2.toArray()[1]). It should be noted that two edges composed by the same vertices can be different (which is allowed to happen in multi-graphs, for example).

Note that it is generally necessary to override the hashCode method whenever the equals method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Author:
fabrice.peix@sophia.inria.fr

Method Summary
 E getHead()
          Give the head of this arc.
 E getTail()
          Give the tail of this arc.
 
Methods inherited from interface fr.inria.opengve.bridge.interfaces.Link
contains, getOpposite, isLoop, leadsTo, leavesFrom, toArray, toArray
 

Method Detail

getTail

E getTail()
Give the tail of this arc.

Returns:
The tail of this arc.

getHead

E getHead()
Give the head of this arc.

Returns:
The head of this arc.


Copyright © 2009 INRIA (Projet Mascotte). All Rights Reserved.