org.ascape.util.sweep
Class SweepLink

java.lang.Object
  extended by org.ascape.util.sweep.SweepLink
All Implemented Interfaces:
Sweepable

public class SweepLink
extends java.lang.Object
implements Sweepable

A sweep link allows two or more sweep dimensions to be iterated together. When next is called, all memebers of the sweep link are iterated. hasNext returns false when all memebers no longer return true for haveNext. So fo instance, the link composed of members with values {1.0, 1.1, 1.2} and {.1, .2, .3, .4} would set values to {(1.0, .1), (1.1, .2), (1.2, .3), (1.2, .4)}. SweepLinks may be nested, of course.

Since:
1.9
Version:
1.9
Author:
Miles Parker

Constructor Summary
SweepLink()
           
 
Method Summary
 void addMember(Sweepable sweep)
          Adds the sweepable item to be iterated with the link.
 java.util.Enumeration elements()
          Returns the memebers as an enumeration.
 Sweepable getMember(int pos)
          Returns the sweepable at the provided location.
 int getSize()
          Returns the size of the links.
 boolean hasNext()
          Returns true if any memebrs still have next states.
 java.lang.Object next()
          Sets all of the linked member's next state.
 void reset()
          Resets the memebrs to their initial states.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SweepLink

public SweepLink()
Method Detail

addMember

public void addMember(Sweepable sweep)
Adds the sweepable item to be iterated with the link.


getMember

public Sweepable getMember(int pos)
Returns the sweepable at the provided location.


reset

public void reset()
Resets the memebrs to their initial states.

Specified by:
reset in interface Sweepable

hasNext

public boolean hasNext()
Returns true if any memebrs still have next states.

Specified by:
hasNext in interface Sweepable

elements

public java.util.Enumeration elements()
Returns the memebers as an enumeration.


next

public java.lang.Object next()
Sets all of the linked member's next state.

Specified by:
next in interface Sweepable

getSize

public int getSize()
Returns the size of the links.



Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.