jwo.landserf.process
Class PolySurfaceThread

java.lang.Object
  extended by java.lang.Thread
      extended by jwo.landserf.process.LSThread
          extended by jwo.landserf.process.PolySurfaceThread
All Implemented Interfaces:
Runnable, Substitutable, JWInterruptionListener

public class PolySurfaceThread
extends LSThread
implements Substitutable

Calculates a polynomial surface.

Version:
2.3, 12th February, 2007.
Author:
Jo Wood

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PolySurfaceThread(GISFrame gisFrame, RasterMap origRast1, String polynomial)
          Creates a polynomial surface with the given expression.
 
Method Summary
 Object doFunction(Vector function)
          Would substitute the given function with an appropriate value.
 void doProcessing()
          Create the polynomial surface.
 int getReturnType()
          Reports the type of value returned by a call to getValue.
 Object getValue(String varName)
          Substitutes the given variable name with an appropriate value.
 void setFocalModifier(double xOffset, double yOffset)
          Allows a focal modifier (relative spatial offset) to be set.
 
Methods inherited from class jwo.landserf.process.LSThread
checkStoppedThread, interruptionRequested, resetTimer, run, setErrorMessage, setFinalMessage, setMessage
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolySurfaceThread

public PolySurfaceThread(GISFrame gisFrame,
                         RasterMap origRast1,
                         String polynomial)
Creates a polynomial surface with the given expression. Note that the raster created by this thread will be set to be the primary raster so that the previous primary raster (origRast1) must be passed to this constructor as a separate parameter.

Parameters:
gisFrame - Frame in which to report results.
origRast1 - Original primary raster (contains z1 values).
polynomial - Polynomial to calculate.
Method Detail

doProcessing

public void doProcessing()
Create the polynomial surface. Note that unlike some of the classes in the jwo.landserf.process package, this class does not create a new raster map, but instead 'fills' the existing primary raster stored in the GISFrame provided to the constructor. This is to make it easier to allow a polynomial surface to be created by default in a new GISFrame. To retrieve the polynomial surface, call GISFrame.getRaster1() after this process has completed.

Note that this method will be called automatically if this is run as a threaded process (e.g. myPolySurfaceThread.start()). Alternatively it can be called directly as a non-threaded process.

Specified by:
doProcessing in class LSThread
See Also:
GISFrame

getValue

public Object getValue(String varName)
Substitutes the given variable name with an appropriate value.

Specified by:
getValue in interface Substitutable
Parameters:
varName - Name of variable to substitute.
Returns:
Value associated with variable or null if variable name not known.

getReturnType

public int getReturnType()
Reports the type of value returned by a call to getValue. This will always be MatheEvaluator.EXPR_NUMERIC.

Specified by:
getReturnType in interface Substitutable
Returns:
Type of value returned by the substitutable object.

setFocalModifier

public void setFocalModifier(double xOffset,
                             double yOffset)
Allows a focal modifier (relative spatial offset) to be set.

Specified by:
setFocalModifier in interface Substitutable
Parameters:
xOffset - Offset in the x direction.
yOffset - Offset in the y direction.

doFunction

public Object doFunction(Vector function)
Would substitute the given function with an appropriate value. In this case nothing is done since the polynomial expression cannot contain user functions.

Specified by:
doFunction in interface Substitutable
Parameters:
function - Name and parameters of function to call.
Returns:
Always returns null since no function substitution takes place.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009