soccerclient.datamanager
Class Ball

java.lang.Object
  |
  +--soccerclient.datamanager.Ball
All Implemented Interfaces:
java.io.Serializable

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

Überschrift: Ball

Beschreibung: In this class some information about ball are safed, like coordinates, time of the last information or the probably future coordinates

Copyright: Copyright (c) 2002

Organisation: pm39

Author:
J.F.G
See Also:
Serialized Form

Constructor Summary
Ball()
          Creates a new Ball instance with coordinates (0,0)
Ball(Coordinate k, int time)
          Creates a new Ball
Ball(double xAchse, double yAchse, int time)
          Creates a new Coordinate
 
Method Summary
 Coordinate getAktBall()
          Returns the last recieved coordinates
 Coordinate getNewBall()
          Returns the probably coordinates where the player could get the ball
 Coordinate getOldBall()
          Returns the second to last recieved coordinates
 double getSpeed()
          Returns speed of Ball, which is the distance between the last two recieved ballpositions
 int getTimeStamp()
          Returns the time of the last recieved information
 void setBall(Coordinate k, int time, Coordinate ownPosition)
          Sets the value of the coordinates
 void setBall(double xAchse, double yAchse, int time, Coordinate ownPosition)
          Sets the value of the coordinates
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ball

public Ball()
Creates a new Ball instance with coordinates (0,0)

Ball

public Ball(Coordinate k,
            int time)
Creates a new Ball
Parameters:
k - a Coordinate value specifying coordinates
time - a int value specifying time

Ball

public Ball(double xAchse,
            double yAchse,
            int time)
Creates a new Coordinate
Parameters:
xAchse - a double value specifying x-coordinate
yAchse - a double value specifying y-coordinate
time - a int value specifying time
Method Detail

getAktBall

public Coordinate getAktBall()
Returns the last recieved coordinates
Returns:
a Coordinate containing the last recieved coordinates

getOldBall

public Coordinate getOldBall()
Returns the second to last recieved coordinates
Returns:
a Coordinate containing the second to last recieved coordinates

getSpeed

public double getSpeed()
Returns speed of Ball, which is the distance between the last two recieved ballpositions
Returns:
a double containing speed of ball

getTimeStamp

public int getTimeStamp()
Returns the time of the last recieved information
Returns:
a int containing timestamp

getNewBall

public Coordinate getNewBall()
Returns the probably coordinates where the player could get the ball
Returns:
a Coordinate containing probably next coordinates

setBall

public void setBall(Coordinate k,
                    int time,
                    Coordinate ownPosition)
Sets the value of the coordinates
Parameters:
k - a Coordinate value specifying coordinates
time - a int value specifying time
ownPosition - a Coordinate

setBall

public void setBall(double xAchse,
                    double yAchse,
                    int time,
                    Coordinate ownPosition)
Sets the value of the coordinates
Parameters:
xAchse - a double value specifying x-coordinate
yAchse - a double value specifying y-coordinate
time - a int value specifying time
ownPosition - a Coordinate