Class Ferry

java.lang.Object
  |
  +--Ferry

class Ferry
extends java.lang.Object


Field Summary
private  int[] capacity
           
private  boolean ferryempty
           
private  boolean ferryfull
           
private  int nextin
           
private  int nextout
           
private  java.awt.TextArea output
           
private  int temp
           
private  boolean yesno
           
 
Constructor Summary
Ferry(java.awt.TextArea ta)
          Constructor Initializing the output textbox
 
Method Summary
 void add(int c)
          The Synchronized thread used to add in new customers.
 void carry(int z)
          Synchronized thread used to take the customers into the ferry.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

capacity

private int[] capacity

nextout

private int nextout

nextin

private int nextin

temp

private int temp

yesno

private boolean yesno

ferryfull

private boolean ferryfull

ferryempty

private boolean ferryempty

output

private java.awt.TextArea output
Constructor Detail

Ferry

public Ferry(java.awt.TextArea ta)
Constructor Initializing the output textbox
Method Detail

carry

public void carry(int z)
Synchronized thread used to take the customers into the ferry. This method accepts the trip number of the ferry. This checks to see if there are less than 5 customers, if so the ferry dose'nt leave.

add

public void add(int c)
The Synchronized thread used to add in new customers. This method checks to see if there are 15 or more customers waiting to go in the ferry, if so it does'nt add in more customers.