org.opensourcephysics.sip.ch07
Class Box

java.lang.Object
  extended by org.opensourcephysics.sip.ch07.Box
All Implemented Interfaces:
Drawable

public class Box
extends java.lang.Object
implements Drawable

Box contains data for articles in a partitioned box.


Field Summary
 int N
           
 int nleft
           
 int time
           
 double[] x
           
 double[] y
           
 
Constructor Summary
Box()
           
 
Method Summary
 void draw(DrawingPanel panel, java.awt.Graphics g)
          Draws particles and partitioned box
 void initialize()
          Initializes the box, places particles in random positions on left side.
 void step()
          Moves one particle to the other side
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public double[] x

y

public double[] y

N

public int N

nleft

public int nleft

time

public int time
Constructor Detail

Box

public Box()
Method Detail

initialize

public void initialize()
Initializes the box, places particles in random positions on left side.


step

public void step()
Moves one particle to the other side


draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics g)
Draws particles and partitioned box

Specified by:
draw in interface Drawable