Class EmissionApplet.Electron

java.lang.Object
  |
  +--EmissionApplet.Electron
Direct Known Subclasses:
FourLevels.Electron
Enclosing class:
EmissionApplet

public class EmissionApplet.Electron
extends java.lang.Object

Models an electron


Field Summary
protected  boolean excited
           
protected  double progress
           
protected  double x
           
 
Constructor Summary
EmissionApplet.Electron(double x)
          Creates a new (non-excited) electron
 
Method Summary
 void absorb(EmissionApplet.Photon p)
          Absorbs the specified photon, causing this electron to become excited.
 boolean canAbsorb()
          Indicates whether this electron is in a suitable state to absorb a photon.
 boolean canEmit()
          Indicates whether this electron is in a suitable state for stimulated emission of a photon.
 void emit(EmissionApplet.Photon p)
          Emits the specified photon, causing this electron to become non-excited.
 boolean isExcited()
           
 boolean isMoving()
           
 void paint(java.awt.Graphics g, double xscl, double yscl)
          Displays this Electron
 void pump()
          Moves this electron to the upper energy level
 void setExcited(boolean b)
          Immediately (without animation) moves this electron to the specified energy level.
 void update(double dt)
          Advances this photon through time by the specified interval
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

excited

protected boolean excited

x

protected double x

progress

protected double progress
Constructor Detail

EmissionApplet.Electron

public EmissionApplet.Electron(double x)
Creates a new (non-excited) electron
Parameters:
x - The x position
Method Detail

paint

public void paint(java.awt.Graphics g,
                  double xscl,
                  double yscl)
Displays this Electron
Parameters:
g - The Graphics surface on which to paint
xscl - Multiplier to convert simulation x coordinates to screen coordinates
yscl - Multiplier to convert simulation y coordinates to screen coordinates

isExcited

public boolean isExcited()
Returns:
true if this electron is excited, else false

absorb

public void absorb(EmissionApplet.Photon p)
Absorbs the specified photon, causing this electron to become excited.

emit

public void emit(EmissionApplet.Photon p)
Emits the specified photon, causing this electron to become non-excited.

isMoving

public boolean isMoving()
Returns:
true if this electron is in transition between energy levels, false if this electron is stationary.

canAbsorb

public boolean canAbsorb()
Indicates whether this electron is in a suitable state to absorb a photon.

canEmit

public boolean canEmit()
Indicates whether this electron is in a suitable state for stimulated emission of a photon.

update

public void update(double dt)
Advances this photon through time by the specified interval

pump

public void pump()
Moves this electron to the upper energy level

setExcited

public void setExcited(boolean b)
Immediately (without animation) moves this electron to the specified energy level.
Parameters:
b - true if the electron is to be moved to the upper energy level, false if the electron is to be moved to the lower energy level.