All Packages Class Hierarchy This Package Previous Next Index
Class gpsys.cos.Vector2Mod10
java.lang.Object
|
+----gpsys.cos.Vector2Mod10
- public class Vector2Mod10
- extends Object
- implements Serializable
The Vector2Mod10 type is a 2 element vector consisting of numbers in the
range 0 to 9. The modulo 10 arithmetic is used to guarantee that the
elements stay in this range.
- Author:
- Emmanuel PIERRE
DEA IARFA,
-
x
- The first element of the vector.
-
y
- The second element of the vector.
-
Zero
- The zero Vector2Mod10 (0,0).
-
Vector2Mod10(int, int)
- Construct a new Vector2Mod10 object with the elements initialised to
the specified values.
-
add(Vector2Mod10, Vector2Mod10)
- Construct a new Vector2Mod10 object which is the sum of the specified
Vector2Mod10 objects.
-
toString()
- Creates a String representing this Vector2Mod10 object.
x
int x
- The first element of the vector.
y
int y
- The second element of the vector.
Zero
public static final Vector2Mod10 Zero
- The zero Vector2Mod10 (0,0).
Vector2Mod10
public Vector2Mod10(int x,
int y)
- Construct a new Vector2Mod10 object with the elements initialised to
the specified values. Modulo 10 arithmetic is used to ensure that the
elements are in the range 0 to 9.
- Parameters:
- x - The first element of the Vector.
- x - The second element of the Vector.
add
public static final Vector2Mod10 add(Vector2Mod10 v1,
Vector2Mod10 v2)
- Construct a new Vector2Mod10 object which is the sum of the specified
Vector2Mod10 objects. Modulo 10 arithmetic is used to ensure that the
elements are in the range 0 to 9.
- Parameters:
- v1 - The first Vector2Mod10 object.
- v2 - The second Vector2Mod10 object.
toString
public String toString()
- Creates a String representing this Vector2Mod10 object.
- Returns:
- A String representing this object.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index