scratch.danyel.simplegraph
Class SimpleGraph

java.lang.Object
  extended by scratch.danyel.simplegraph.SimpleGraph
All Implemented Interfaces:
Iterable, Collection

public class SimpleGraph
extends Object
implements Collection

Author:
danyelf

Constructor Summary
SimpleGraph()
           
 
Method Summary
 boolean add(Object arg0)
           
 boolean addAll(Collection arg0)
           
 void addEdge(Object v1, Object v2)
          By default, adds an undirected edge
 void addEdge(Object v1, Object v2, boolean isDirected)
           
 void clear()
           
 boolean contains(Object arg0)
           
 boolean containsAll(Collection arg0)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean remove(Object arg0)
           
 boolean removeAll(Collection arg0)
           
 boolean retainAll(Collection arg0)
           
 int size()
          Returns the number of Vertices
 Object[] toArray()
           
 Object[] toArray(Object[] arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

SimpleGraph

public SimpleGraph()
Method Detail

size

public int size()
Returns the number of Vertices

Specified by:
size in interface Collection
See Also:
Collection.size()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
See Also:
Collection.isEmpty()

contains

public boolean contains(Object arg0)
Specified by:
contains in interface Collection
See Also:
Collection.contains(java.lang.Object)

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
See Also:
Collection.iterator()

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
See Also:
Collection.toArray()

toArray

public Object[] toArray(Object[] arg0)
Specified by:
toArray in interface Collection
See Also:
Collection.toArray(java.lang.Object[])

add

public boolean add(Object arg0)
Specified by:
add in interface Collection
See Also:
Collection.add(java.lang.Object)

addEdge

public void addEdge(Object v1,
                    Object v2)
By default, adds an undirected edge


addEdge

public void addEdge(Object v1,
                    Object v2,
                    boolean isDirected)

remove

public boolean remove(Object arg0)
Specified by:
remove in interface Collection
See Also:
Collection.remove(java.lang.Object)

containsAll

public boolean containsAll(Collection arg0)
Specified by:
containsAll in interface Collection
See Also:
Collection.containsAll(java.util.Collection)

addAll

public boolean addAll(Collection arg0)
Specified by:
addAll in interface Collection
See Also:
Collection.addAll(java.util.Collection)

removeAll

public boolean removeAll(Collection arg0)
Specified by:
removeAll in interface Collection
See Also:
Collection.removeAll(java.util.Collection)

retainAll

public boolean retainAll(Collection arg0)
Specified by:
retainAll in interface Collection
See Also:
Collection.retainAll(java.util.Collection)

clear

public void clear()
Specified by:
clear in interface Collection
See Also:
Collection.clear()