opale.m2d.ker
Class Object2D

java.lang.Object
  |
  +--opale.m2d.ker.Object2D
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Conic, Data2D, FPolar, Line2D, Point2D, Vector2D, xyFt, yFx

public abstract class Object2D
extends java.lang.Object
implements java.lang.Cloneable

This abstract class is the root of the class hierarchy that represents an object 2D.

Since:
Opale-2d 0.1
Author:
OC

Constructor Summary
Object2D()
          Constructs and initializes with the absolute OIJ.
Object2D(OIJ rep)
          Constructs and initializes with an specified OIJ.
 
Method Summary
abstract  void changeOIJ(OIJ rep)
          Computes the changement of OIJ for this object.
 java.lang.Object clone()
          Creates a new object of the same class and with the same contents as this vector.
 OIJ getOIJ()
          Returns the instance OIJ of this object.
 void readFile(RFile f, Pack2D pack)
          Reads in a file the construction of this object calling the method readKeyWord().
abstract  int readKeyWord(java.lang.String word, RFile f, Pack2D pack)
          Interpret a keyword read in a file.
 void setOIJ(OIJ rep)
          Sets the OIJ basis of this object.
abstract  java.lang.String toString()
          Returns a string representation of this object.
 void writeFile(WFile f, Pack2D pack)
          Writes informations about this object in a file.
abstract  void writeFileMore(WFile f, Pack2D pack)
          Wrtie complementary information in a file.
 double xmax()
          Returns the maximum of the X coordinate.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Object2D

public Object2D()
Constructs and initializes with the absolute OIJ.

Object2D

public Object2D(OIJ rep)
Constructs and initializes with an specified OIJ.
Parameters:
OIJ - rep, an instance of OIJ.
Method Detail

setOIJ

public void setOIJ(OIJ rep)
Sets the OIJ basis of this object.
Parameters:
OIJ - rep, the new OIJ.

getOIJ

public OIJ getOIJ()
Returns the instance OIJ of this object.
Returns:
OIJ rep, the basis of this object.

clone

public java.lang.Object clone()
Creates a new object of the same class and with the same contents as this vector.
Overrides:
clone in class java.lang.Object
Returns:
Object, a clone of this instance.
Throws:
OutOfMemoryError - if there is not enough memory.
See Also:
Cloneable

readFile

public void readFile(RFile f,
                     Pack2D pack)
              throws java.io.IOException,
                     MalformedFileException
Reads in a file the construction of this object calling the method readKeyWord().
Parameters:
RFile - f, the file to read.

changeOIJ

public abstract void changeOIJ(OIJ rep)
Computes the changement of OIJ for this object.
Parameters:
OIJ - rep, the new OIJ.

toString

public abstract java.lang.String toString()
Returns a string representation of this object.
Overrides:
toString in class java.lang.Object

readKeyWord

public abstract int readKeyWord(java.lang.String word,
                                RFile f,
                                Pack2D pack)
                         throws java.io.IOException,
                                MalformedFileException
Interpret a keyword read in a file.
Parameters:
String - word, the keyword.
RFile - f, the file in reading.
Pack2D - p, instance of Pack2D that contains the requiered objects.
Returns:
int, 0 if the keyword is good, -1 otherwise.

writeFile

public void writeFile(WFile f,
                      Pack2D pack)
               throws MalformedFileException
Writes informations about this object in a file.
Parameters:
WFile - f, the file in writing.

writeFileMore

public abstract void writeFileMore(WFile f,
                                   Pack2D pack)
Wrtie complementary information in a file.
Parameters:
WFile - f, the file in writing .

xmax

public double xmax()
Returns the maximum of the X coordinate.
Returns:
double, X maximum.