gpsys.lawnmower
Class Vector2Mod8

java.lang.Object
  |
  +--gpsys.lawnmower.Vector2Mod8

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

The Vector2Mod8 type is a 2 element vector consisting of numbers in the range 0 to 7. The modulo 8 arithmetic is used to guarantee that the elements stay in this range.

Version:
$Revision: 1.1 $, $Date: 2000/07/05 16:26:49 $
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
See Also:
Serialized Form

Field Summary
(package private)  int x
          The first element of the vector.
(package private)  int y
          The second element of the vector.
static Vector2Mod8 Zero
          The zero Vector2Mod8 (0,0).
 
Constructor Summary
Vector2Mod8(int x, int y)
          Construct a new Vector2Mod8 object with the elements initialised to the specified values.
 
Method Summary
static Vector2Mod8 add(Vector2Mod8 v1, Vector2Mod8 v2)
          Construct a new Vector2Mod8 object which is the sum of the specified Vector2Mod8 objects.
 java.lang.String toString()
          Creates a String representing this Vector2Mod8 object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

x

int x
The first element of the vector.

y

int y
The second element of the vector.

Zero

public static final Vector2Mod8 Zero
The zero Vector2Mod8 (0,0).
Constructor Detail

Vector2Mod8

public Vector2Mod8(int x,
                   int y)
Construct a new Vector2Mod8 object with the elements initialised to the specified values. Modulo 8 arithmetic is used to ensure that the elements are in the range 0 to 7.
Parameters:
x - The first element of the Vector.
x - The second element of the Vector.
Method Detail

add

public static final Vector2Mod8 add(Vector2Mod8 v1,
                                    Vector2Mod8 v2)
Construct a new Vector2Mod8 object which is the sum of the specified Vector2Mod8 objects. Modulo 8 arithmetic is used to ensure that the elements are in the range 0 to 7.
Parameters:
v1 - The first Vector2Mod8 object.
v2 - The second Vector2Mod8 object.

toString

public java.lang.String toString()
Creates a String representing this Vector2Mod8 object.
Returns:
A String representing this object.
Overrides:
toString in class java.lang.Object