za.co.luma.geom
Class SegmentSet

java.lang.Object
  extended by za.co.luma.geom.SegmentSet
All Implemented Interfaces:
java.lang.Iterable<Segment>

public class SegmentSet
extends java.lang.Object
implements java.lang.Iterable<Segment>

A SegmentSet is an iterable collection of Segments.

Author:
Herman Tulleken

Constructor Summary
SegmentSet()
          Creates a new empty SegmentSet.
 
Method Summary
 boolean add(Segment segment)
          Adds a new Segment to this SegementSet.
 boolean addAll(java.util.Collection<? extends Segment> c)
          Adss all the Segments in the given collection to this SegmentSet.
 boolean addAll(SegmentSet set)
          Add all the segments in the given SegmentSet to this SegmentSet.
 void clear()
          Removes all Segments from this SegmentSet.
 java.util.Iterator<Segment> iterator()
          Returns an ierator for this SegmentSet.
 boolean remove(java.lang.Object segment)
          Removes a Segment from this SegmentSet.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SegmentSet

public SegmentSet()
Creates a new empty SegmentSet.

Method Detail

addAll

public boolean addAll(java.util.Collection<? extends Segment> c)
Adss all the Segments in the given collection to this SegmentSet.


addAll

public boolean addAll(SegmentSet set)
Add all the segments in the given SegmentSet to this SegmentSet.


add

public boolean add(Segment segment)
Adds a new Segment to this SegementSet.

Parameters:
segment - The segment to add
Returns:
whether the Segment has been successfully added.

clear

public void clear()
Removes all Segments from this SegmentSet.


iterator

public java.util.Iterator<Segment> iterator()
Returns an ierator for this SegmentSet.

Specified by:
iterator in interface java.lang.Iterable<Segment>

remove

public boolean remove(java.lang.Object segment)
Removes a Segment from this SegmentSet.

Parameters:
segment - The segment to remove.
Returns:

toString

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