All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gpsys.lawnmower.Vector2Mod8

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

public class Vector2Mod8
extends Object
implements 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:
1.1, 30th June '97
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.

Variable Index

 o Zero
The zero Vector2Mod8 (0,0).

Constructor Index

 o Vector2Mod8(int, int)
Construct a new Vector2Mod8 object with the elements initialised to the specified values.

Method Index

 o add(Vector2Mod8, Vector2Mod8)
Construct a new Vector2Mod8 object which is the sum of the specified Vector2Mod8 objects.
 o toString()
Creates a String representing this Vector2Mod8 object.

Variables

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

Constructors

 o 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.

Methods

 o 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.
 o toString
 public String toString()
Creates a String representing this Vector2Mod8 object.

Returns:
A String representing this object.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index