MOEA Framework 2.12
API Specification

org.moeaframework.algorithm.pisa
Class State

java.lang.Object
  extended by org.moeaframework.algorithm.pisa.State

public class State
extends Object

Reads and writes PISA state files.


Constructor Summary
State(File file)
          Constructs a state indicator backed by the specified file.
 
Method Summary
 int get()
          Reads the state.
 void set(int state)
          Sets the state.
 void waitFor(int state)
          Blocks until the state becomes the specified value.
 int waitWhile(int state)
          Blocks while the state remains at the specified value, returning the new state value when it changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

State

public State(File file)
Constructs a state indicator backed by the specified file.

Parameters:
file - the state file
Method Detail

get

public int get()
        throws IOException
Reads the state.

Returns:
the state
Throws:
IOException - if an I/O error occurred

set

public void set(int state)
         throws IOException,
                InterruptedException
Sets the state.

Parameters:
state - the state
Throws:
IOException - if an I/O error occurred
InterruptedException - if Thread.sleep(long) was interrupted

waitFor

public void waitFor(int state)
             throws IOException,
                    InterruptedException
Blocks until the state becomes the specified value.

Parameters:
state - the state to wait for
Throws:
IOException - if an I/O error occurred
InterruptedException - if Thread.sleep(long) was interrupted

waitWhile

public int waitWhile(int state)
              throws IOException,
                     InterruptedException
Blocks while the state remains at the specified value, returning the new state value when it changes.

Parameters:
state - the state to wait on
Returns:
the new state
Throws:
IOException - if an I/O error occurred
InterruptedException - if Thread.sleep(long) was interrupted

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!