reservation.system
Class Pos

java.lang.Object
  extended byreservation.system.Pos
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Pos
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This class hold Pos structure. This object define the dimention of a Flight and the seat for a Person.

Author:
Texier Mathieu and Frederic Bidon
See Also:
Serialized Form

Constructor Summary
Pos(short row, short col)
          Construct a Pos object.
 
Method Summary
 void _check()
          Verify invariants : - dimension > 0
protected  java.lang.Object clone()
          Creates and returns a copy of this object.
 boolean equals(java.lang.Object anObject)
          Overide equals
 short getCol()
          Return The length of a row for a Flight and the col of the seat for a Person.
 short getRow()
          Return The number of rows for a Flight and the row of the seat for a Person.
 java.lang.String toString()
          Returns a string representation of this Flight object.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pos

public Pos(short row,
           short col)
    throws java.lang.Exception
Construct a Pos object.

Parameters:
row - The number of rows for a Flight and the row of the seat for a Person.
col - The length of a row for a Flight and the col of the seat for a Person.
Throws:
java.lang.Exception - When value dosn't make sense, this exception is thrown
Method Detail

getRow

public short getRow()
             throws java.lang.Exception
Return The number of rows for a Flight and the row of the seat for a Person.

Returns:
the row
Throws:
java.lang.Exception - when the invariant is violated

getCol

public short getCol()
             throws java.lang.Exception
Return The length of a row for a Flight and the col of the seat for a Person.

Returns:
the col
Throws:
java.lang.Exception - when the invariant is violated

equals

public boolean equals(java.lang.Object anObject)
Overide equals

Parameters:
anObject - anObject - the reference object with which to compare
Returns:
true if this object is the same as the obj argument; false otherwise

toString

public java.lang.String toString()
Returns a string representation of this Flight object. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null

Returns:
a string representation of this Pos object.

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Returns:
a copy of this Pos object
Throws:
java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface.

_check

public void _check()
            throws java.lang.Exception
Verify invariants :
 - dimension > 0
 

Throws:
java.lang.Exception - if the invariant is violated