de.tubs.cs.sc.casim
Class BoundaryHandler

java.lang.Object
  |
  +--de.tubs.cs.sc.casim.BoundaryHandler
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ConstantBoundaryHandler, PeriodicBoundaryHandler, ReflectivBoundaryHandler

public abstract class BoundaryHandler
extends java.lang.Object
implements java.io.Serializable

A BoundaryHandler is always connected to one border of a lattice. One dimensional lattices can have two boundary handlers a left and a right one. The left one has negative direction and the right one has positive. Two dimensional lattices can hav four boundary handlers a left, right, bottom and top one. The left and the bottom have negative direction, the right and top one positive. Three dimensional lattices can have six boundary handlers, the four like two dimensional lattices and additional a front and rear boundary handler. The front one has negative direction, the rear positive.

See Also:
Serialized Form

Field Summary
protected  int dimension
           
protected  boolean direction
           
static int FIRST_DIMENSION
          first dimension x, from left to right
protected  de.tubs.cs.sc.casim.Lattice lattice
           
static boolean NEGATIVE
          the negative direction
static boolean POSITIVE
          the positive direction
static int SECOND_DIMENSION
          second dimension y, from bottom to top
static int THIRD_DIMENSION
          third dimension z, from front to rear
 
Constructor Summary
BoundaryHandler(int myDim, boolean positive, de.tubs.cs.sc.casim.Lattice l)
          Constructor creates a BoundaryHandler with the given parameters.
 
Method Summary
 int getDimension()
           
 boolean getDirection()
           
abstract  de.tubs.cs.sc.casim.State getOutsideState(int x)
          The derived classes should return the requested old state outside current lattice.
abstract  de.tubs.cs.sc.casim.State getOutsideState(int x, int y)
           
abstract  de.tubs.cs.sc.casim.State getOutsideState(int x, int y, int z)
           
 void readyForBackup(int step)
          a virtual method for waiting for ready state for backup all cells of the lattice must be derived if any synchronizing mechanisms are necessary i.e.
 void readyForTransition(int step)
          a virtual method for waiting for transition state for backup all cells of the lattice must be derived if any synchronizing mechanisms are necessary i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_DIMENSION

public static final int FIRST_DIMENSION
first dimension x, from left to right

See Also:
Constant Field Values

SECOND_DIMENSION

public static final int SECOND_DIMENSION
second dimension y, from bottom to top

See Also:
Constant Field Values

THIRD_DIMENSION

public static final int THIRD_DIMENSION
third dimension z, from front to rear

See Also:
Constant Field Values

POSITIVE

public static final boolean POSITIVE
the positive direction

See Also:
Constant Field Values

NEGATIVE

public static final boolean NEGATIVE
the negative direction

See Also:
Constant Field Values

dimension

protected int dimension

direction

protected boolean direction

lattice

protected de.tubs.cs.sc.casim.Lattice lattice
Constructor Detail

BoundaryHandler

public BoundaryHandler(int myDim,
                       boolean positive,
                       de.tubs.cs.sc.casim.Lattice l)
Constructor creates a BoundaryHandler with the given parameters.

See Also:
Lattice
Method Detail

getDimension

public final int getDimension()
Returns:
the dimension for which the handler is responsible

getDirection

public final boolean getDirection()
Returns:
the direction for which the handler is responsible

readyForBackup

public void readyForBackup(int step)
a virtual method for waiting for ready state for backup all cells of the lattice must be derived if any synchronizing mechanisms are necessary i.e. between threads or processes bas class does nothing


readyForTransition

public void readyForTransition(int step)
a virtual method for waiting for transition state for backup all cells of the lattice must be derived if any synchronizing mechanisms are necessary i.e. between threads or processes bas class does nothing


getOutsideState

public abstract de.tubs.cs.sc.casim.State getOutsideState(int x)
The derived classes should return the requested old state outside current lattice. If the lattice detects, that a state outside itself is requested, the lattice checks for a matching BoundaryHandler at this border and calls getOutsideState


getOutsideState

public abstract de.tubs.cs.sc.casim.State getOutsideState(int x,
                                                          int y)

getOutsideState

public abstract de.tubs.cs.sc.casim.State getOutsideState(int x,
                                                          int y,
                                                          int z)