server
Class Fish

java.lang.Object
  |
  +--server.Fish
All Implemented Interfaces:
java.io.Serializable

public class Fish
extends java.lang.Object
implements java.io.Serializable

This is an object representing a fish that is to be passed between servers.

Author:
Ben Litchfield
See Also:
Serialized Form

Field Summary
 int XCOORD
           
 int YCOORD
           
 
Constructor Summary
Fish(java.awt.Image i, java.lang.String n, java.lang.String mail)
          constructor for Fish
 
Method Summary
 java.lang.String getFishID()
          gets the Fish's ID
 java.awt.Image getImage()
          gets the image of the fish
 FishMail getMail()
          this will return the mail that needs to be sent for this fish
 FishPOS getPOS()
          this returns the positional data of the fish
 boolean move()
          this moves the fish one spot
 void setID(java.lang.String newID)
          set the ID of the Fish
 void setPOS(int newX, int newY)
          set the position of the fish
 java.lang.String toString()
          String represention of the fish
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XCOORD

public int XCOORD

YCOORD

public int YCOORD
Constructor Detail

Fish

public Fish(java.awt.Image i,
            java.lang.String n,
            java.lang.String mail)
constructor for Fish

Parameters:
i - the picture of the fish
n - the name of the fish
mail - the e-mail of the creator of the fish
Method Detail

getMail

public FishMail getMail()
this will return the mail that needs to be sent for this fish

Returns:
the mail of this fish

setPOS

public void setPOS(int newX,
                   int newY)
set the position of the fish


toString

public java.lang.String toString()
String represention of the fish

Overrides:
toString in class java.lang.Object
Returns:
string of the fish

getPOS

public FishPOS getPOS()
this returns the positional data of the fish

Returns:
FishPOS, the positiob and ID of the fish

getImage

public java.awt.Image getImage()
gets the image of the fish

Returns:
the image of the fish

getFishID

public java.lang.String getFishID()
gets the Fish's ID

Returns:
the ID of the Fish

setID

public void setID(java.lang.String newID)
set the ID of the Fish

Parameters:
newID - the ID of the Fish

move

public boolean move()
this moves the fish one spot

Returns:
true if fish is off screen, false otherwise