Class FourLevels.Electron

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

class FourLevels.Electron
extends EmissionApplet.Electron


Field Summary
protected  int energyLevel
          The present energy level, or the energy level toward which the particle is moving.
protected  int oldLevel
          The previoud energy level, or the energy level from which the particle is moving.
 
Fields inherited from class EmissionApplet.Electron
excited, progress, x
 
Constructor Summary
FourLevels.Electron(double x)
          Creates a new electron
FourLevels.Electron(double x, int level)
          Creates a new 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()
          For backward compatibility, returns the same result as canEmit().
 void moveToLevel(int l)
          Causes the electron to begin moving to a specified energy level.
 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)
          For backwards compatibility.
 void update(double dt)
          Advances this photon through time by the specified interval
 
Methods inherited from class EmissionApplet.Electron
isMoving
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

energyLevel

protected int energyLevel
The present energy level, or the energy level toward which the particle is moving.

oldLevel

protected int oldLevel
The previoud energy level, or the energy level from which the particle is moving. This value will be zero if the electron has never changed energy levels.
Constructor Detail

FourLevels.Electron

public FourLevels.Electron(double x,
                           int level)
Creates a new electron
Parameters:
x - The x position
level - An integer in the range [0,3] specifying the initial energy level
Throws:
java.lang.IllegalArgumentException - if level is less than 0 or greateer than 3

FourLevels.Electron

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

paint

public void paint(java.awt.Graphics g,
                  double xscl,
                  double yscl)
Displays this Electron
Overrides:
paint in class EmissionApplet.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

absorb

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

emit

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

pump

public void pump()
Moves this electron to the upper energy level
Overrides:
pump in class EmissionApplet.Electron

isExcited

public boolean isExcited()
For backward compatibility, returns the same result as canEmit().
Overrides:
isExcited in class EmissionApplet.Electron
Tags copied from class: EmissionApplet.Electron
Returns:
true if this electron is excited, else false

canAbsorb

public boolean canAbsorb()
Description copied from class: EmissionApplet.Electron
Indicates whether this electron is in a suitable state to absorb a photon.
Overrides:
canAbsorb in class EmissionApplet.Electron

canEmit

public boolean canEmit()
Description copied from class: EmissionApplet.Electron
Indicates whether this electron is in a suitable state for stimulated emission of a photon.
Overrides:
canEmit in class EmissionApplet.Electron

moveToLevel

public void moveToLevel(int l)
Causes the electron to begin moving to a specified energy level.

update

public void update(double dt)
Advances this photon through time by the specified interval
Overrides:
update in class EmissionApplet.Electron

setExcited

public void setExcited(boolean b)
For backwards compatibility. Sets the energy level to one of the two centre states.
Overrides:
setExcited in class EmissionApplet.Electron
Parameters:
b - true if the electron is to be moved to state 1, false if it is to move to state 2.