optics
Class Optics

java.lang.Object
  extended by optics.Optics
Direct Known Subclasses:
Constants, Grid, Label2D, Mask, OpticalSurface, ParaxialMatrix, ParaxialPlanes, PrintMonitor, Ray, RayAberration, RayPath, Singlet2D, SurfaceFunction, WaveLengthFunction

public abstract class Optics
extends java.lang.Object

Abstract class with all other Optics classes extends. This contains the version number microns conversion and format string and error PrintStream.


Field Summary
static double DEFAULT_WAVELENGTH
          Public static to set the default wavelength, initially set to Constants.GREEN
protected static java.io.PrintStream errorStream
          PrintStream for error messages.
protected static java.lang.String fmt
          String to format a double.
static double MICRONS
          Public static to scale package distance units to microns.
 
Constructor Summary
Optics()
           
 
Method Summary
 double getDefaultWaveLength()
          Method to get the default wavelength in microns.
 java.io.PrintStream getErrorStream()
          Method to get the current errorStream
 java.lang.String getFormatString()
          Method to get the current format string.
 java.lang.String getName()
          Method to get the class name as a String with leading package details removed.
static java.lang.String getStaticName(java.lang.Object o)
          Static method to get get the name of an object.
 java.lang.String getVersion()
          Method to get the package version.
 void printError(java.lang.String e)
          Method to print an error message to current errorStream
 void setDefaultWaveLength(double lambda)
          Method to se tthe default wavelength in microns.
 void setErrorStream(java.io.PrintStream ps)
          Method to set the errorStream where warning and error message are printed.
 void setFormatString(java.lang.String s)
          Method to set the double format String, the default is %g.
 void setMicrons(double microns)
          Method to set the global static for microns conversion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WAVELENGTH

public static double DEFAULT_WAVELENGTH
Public static to set the default wavelength, initially set to Constants.GREEN


MICRONS

public static double MICRONS
Public static to scale package distance units to microns. Default package units is mm, so default value is 1000.


fmt

protected static java.lang.String fmt
String to format a double. Defaults to "%g"


errorStream

protected static java.io.PrintStream errorStream
PrintStream for error messages. Defaults to System.err.

Constructor Detail

Optics

public Optics()
Method Detail

getVersion

public java.lang.String getVersion()
Method to get the package version.

Returns:
String the version string

getDefaultWaveLength

public double getDefaultWaveLength()
Method to get the default wavelength in microns.

Returns:
double the default wavelength

setDefaultWaveLength

public void setDefaultWaveLength(double lambda)
Method to se tthe default wavelength in microns. This is initially set to Constants.GREEN.

Parameters:
lambda - the new default wavelnegth

setMicrons

public void setMicrons(double microns)
Method to set the global static for microns conversion.

Use with extreme care, mostly an untested feature!

Parameters:
microns - package unit to microns conversion.

getFormatString

public java.lang.String getFormatString()
Method to get the current format string.

Returns:
Strin the current format string.

setFormatString

public void setFormatString(java.lang.String s)
Method to set the double format String, the default is %g.

Parameters:
s - the format string

setErrorStream

public void setErrorStream(java.io.PrintStream ps)
Method to set the errorStream where warning and error message are printed.

Parameters:
ps - the PrintStream

getErrorStream

public java.io.PrintStream getErrorStream()
Method to get the current errorStream

Returns:
PrintStream current stream

printError

public void printError(java.lang.String e)
Method to print an error message to current errorStream

Parameters:
e - the error message.

getName

public java.lang.String getName()
Method to get the class name as a String with leading package details removed. Mostly used internally as part of toString methods.

Returns:
String the class name.

getStaticName

public static java.lang.String getStaticName(java.lang.Object o)
Static method to get get the name of an object.

Parameters:
o - the Object
Returns:
String object same as a String.