com.tensegrity.graph.model
Class DirectedMultiEdgeList

java.lang.Object
  extended bycom.tensegrity.graph.model.AbstractEdgeList
      extended bycom.tensegrity.graph.model.DirectedMultiEdgeList
All Implemented Interfaces:
java.util.Collection, java.util.List, java.util.Set

public class DirectedMultiEdgeList
extends com.tensegrity.graph.model.AbstractEdgeList
implements java.util.List, java.util.Set

Special set that eliminates directed multiedges. If you add an edge all equivalent future adds of the same edge are eliminated. The whole concept is to eliminate multi edges for iterators so that graph algorithms still work and don't have to deal with multiedges (which can make some graph algorithms a lot more complicated to implemented).

Version:
$Id: DirectedMultiEdgeList.java,v 1.3 2004/06/29 07:41:22 MichaelKegel Exp $
Author:
S. Rutz

Constructor Summary
DirectedMultiEdgeList()
          Constructs an empty edgeset.
DirectedMultiEdgeList(int initial_capacity)
          Constructs an empty edgeset with the given initial capacity.
 
Method Summary
 boolean add(Edge edge)
          Adds an edge to the set.
 void add(int index, java.lang.Object element)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 boolean add(java.lang.Object o)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 boolean addAll(java.util.Collection c)
          Adds all the elements from the collection c to this collection.
 boolean addAll(int index, java.util.Collection c)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 void clear()
           
 boolean contains(java.lang.Object o)
          Returns true if this collection containts the given object.
 boolean containsAll(java.util.Collection c)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 java.lang.Object get(int index)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 int indexOf(java.lang.Object o)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 boolean isEmpty()
          Returns true iff this collection is empty.
 java.util.Iterator iterator()
          Returns an iterator for this collection.
 int lastIndexOf(java.lang.Object o)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 java.util.ListIterator listIterator()
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 java.util.ListIterator listIterator(int index)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 java.lang.Object remove(int index)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 boolean remove(java.lang.Object o)
          Removes the given object from this collection.
 boolean removeAll(java.util.Collection c)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 boolean retainAll(java.util.Collection c)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 java.lang.Object set(int index, java.lang.Object element)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 int size()
          Returns the number of elements currently stored in this collection.
 java.util.List subList(int fromIndex, int toIndex)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 java.lang.Object[] toArray()
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 java.lang.Object[] toArray(java.lang.Object[] a)
          Operation is forbidden by contract and will throw a DynamicException if it is invoked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

DirectedMultiEdgeList

public DirectedMultiEdgeList()
Constructs an empty edgeset.


DirectedMultiEdgeList

public DirectedMultiEdgeList(int initial_capacity)
Constructs an empty edgeset with the given initial capacity.

Parameters:
initial_capacity - the initial capacity of the set.
Method Detail

add

public boolean add(Edge edge)
Description copied from class: com.tensegrity.graph.model.AbstractEdgeList
Adds an edge to the set.

Parameters:
edge - the edge to add.
Returns:
true if the edge was not previously in the set.

iterator

public java.util.Iterator iterator()
Description copied from class: com.tensegrity.graph.model.AbstractEdgeList
Returns an iterator for this collection.

Specified by:
iterator in interface java.util.List
Returns:
an iterator for this collection.

size

public int size()
Returns the number of elements currently stored in this collection.

Specified by:
size in interface java.util.List
Returns:
the number of elements currently stored in this collection.

isEmpty

public boolean isEmpty()
Returns true iff this collection is empty.

Specified by:
isEmpty in interface java.util.List
Returns:
true iff this collection is empty.

contains

public boolean contains(java.lang.Object o)
Returns true if this collection containts the given object.

Specified by:
contains in interface java.util.List
Parameters:
o - the object to check for.
Returns:
true if this collection containts the given object.

remove

public boolean remove(java.lang.Object o)
Removes the given object from this collection.

Specified by:
remove in interface java.util.List
Parameters:
o - the object to remove from this collection.
Returns:
true if an actual deletion occured.

addAll

public boolean addAll(java.util.Collection c)
Adds all the elements from the collection c to this collection.

Specified by:
addAll in interface java.util.List
Parameters:
c - the collection whose elements are to be added to this collection.
Returns:
true if this collection changed as a result of this method.

clear

public void clear()
Specified by:
clear in interface java.util.List

toArray

public java.lang.Object[] toArray()
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
toArray in interface java.util.List

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
toArray in interface java.util.List

add

public boolean add(java.lang.Object o)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
add in interface java.util.List

containsAll

public boolean containsAll(java.util.Collection c)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
containsAll in interface java.util.List

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
addAll in interface java.util.List

removeAll

public boolean removeAll(java.util.Collection c)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
removeAll in interface java.util.List

retainAll

public boolean retainAll(java.util.Collection c)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
retainAll in interface java.util.List

get

public java.lang.Object get(int index)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
get in interface java.util.List

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
set in interface java.util.List

add

public void add(int index,
                java.lang.Object element)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
add in interface java.util.List

remove

public java.lang.Object remove(int index)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
remove in interface java.util.List

indexOf

public int indexOf(java.lang.Object o)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
indexOf in interface java.util.List

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
lastIndexOf in interface java.util.List

listIterator

public java.util.ListIterator listIterator()
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
listIterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator(int index)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
listIterator in interface java.util.List

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Operation is forbidden by contract and will throw a DynamicException if it is invoked.

Specified by:
subList in interface java.util.List


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.