palmed.edit.util
Class Coordinate

java.lang.Object
  extended by palmed.edit.util.Coordinate
All Implemented Interfaces:
ISerializable

public final class Coordinate
extends java.lang.Object
implements ISerializable

This class encapsulates a two integers coordinate.

Version:
$Revision$ $Date$
Author:
Mathieu Champlon

Field Summary
 int x_
          The abcissa value.
 int y_
          The ordinate value.
 
Constructor Summary
Coordinate()
          Create a coordinate (0,0).
Coordinate(int x, int y)
          Create a coordinate (x,y).
 
Method Summary
 boolean equals(java.lang.Object object)
          
 int hashCode()
          
 boolean lessThan(Coordinate other)
          Test if the coordinate is less than another.
 void marshall(java.io.OutputStream stream)
          Write to an output stream.
 java.lang.String toString()
          
 void unmarshall(java.io.InputStream stream)
          Read from an input stream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x_

public int x_
The abcissa value.


y_

public int y_
The ordinate value.

Constructor Detail

Coordinate

public Coordinate()
Create a coordinate (0,0).


Coordinate

public Coordinate(int x,
                  int y)
Create a coordinate (x,y).

Parameters:
x - abcissa
y - ordinate
Method Detail

equals

public boolean equals(java.lang.Object object)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

lessThan

public boolean lessThan(Coordinate other)
Test if the coordinate is less than another.

Parameters:
other - the other coordinate
Returns:
whether the current coordinate is less than the other or not

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

unmarshall

public void unmarshall(java.io.InputStream stream)
                throws java.io.IOException
Read from an input stream.

Specified by:
unmarshall in interface ISerializable
Parameters:
stream - the stream to read from
Throws:
java.io.IOException - an io exception occurs

marshall

public void marshall(java.io.OutputStream stream)
              throws java.io.IOException
Write to an output stream.

Specified by:
marshall in interface ISerializable
Parameters:
stream - the stream to write to
Throws:
java.io.IOException - an io exception occurs


Copyright © 2004-2006 PalmEd. All Rights Reserved.