org.jpox.sco
Class Point

java.lang.Object
  extended byjava.awt.geom.Point2D
      extended byjava.awt.Point
          extended byorg.jpox.sco.Point
All Implemented Interfaces:
java.lang.Cloneable, SCO, java.io.Serializable

public class Point
extends java.awt.Point
implements SCO

A mutable second-class java.awt.Point object.

Version:
$Revision: 1.18 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.geom.Point2D
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
 
Field Summary
 
Fields inherited from class java.awt.Point
x, y
 
Constructor Summary
Point(StateManager ownerSM, java.lang.String fieldName)
          Creates a Point object.
 
Method Summary
 void attachCopy(java.lang.Object value)
          Method to attach the passed value.
 java.lang.Object clone()
          Creates and returns a copy of this object.
 void detach(FetchPlanState state)
          Method to detach this object.
 java.lang.Object detachCopy(FetchPlanState state)
          Method to detach a copy of this object.
 java.lang.String getFieldName()
          Accessor for the field name
 java.lang.Object getOwner()
          Accessor for the owner.
 void makeDirty()
          Utility to mark the object as dirty
 void makeTransient(FetchPlanState state)
          Method to make transient this object.
 void move(int x, int y)
           
 void runReachability(java.util.Set reachables)
          Method to run reachability on this SCO.
 void setLocation(double x, double y)
          Mutator for the location.
 void setLocation(int x, int y)
          Mutator for the location.
 void setLocation(java.awt.Point point)
          Mutator for the location.
 void setLocation(java.awt.geom.Point2D point)
          Mutator for the location.
 void setValueFrom(java.lang.Object o, boolean forUpdate)
          Mutator for the value, using an object.
 void translate(int dx, int dy)
           
 void unsetOwner()
          Utility to unset the owner.
protected  java.lang.Object writeReplace()
          The writeReplace method is called when ObjectOutputStream is preparing to write the object to the stream.
 
Methods inherited from class java.awt.Point
equals, getLocation, getX, getY, toString
 
Methods inherited from class java.awt.geom.Point2D
distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Point

public Point(StateManager ownerSM,
             java.lang.String fieldName)
Creates a Point object. Assigns owning object and field name.

Parameters:
ownerSM - the owning object
fieldName - the owning field name
Method Detail

clone

public java.lang.Object clone()
Creates and returns a copy of this object.

Mutable second-class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.

Specified by:
clone in interface SCO
Returns:
A clone of the object

setLocation

public void setLocation(double x,
                        double y)
Mutator for the location.

Parameters:
x - The location x
y - The location y

setLocation

public void setLocation(int x,
                        int y)
Mutator for the location.

Parameters:
x - The location x
y - The location y

setLocation

public void setLocation(java.awt.Point point)
Mutator for the location.

Parameters:
point - The location

setLocation

public void setLocation(java.awt.geom.Point2D point)
Mutator for the location.

Parameters:
point - The location

move

public void move(int x,
                 int y)

translate

public void translate(int dx,
                      int dy)

setValueFrom

public void setValueFrom(java.lang.Object o,
                         boolean forUpdate)
Mutator for the value, using an object.

Specified by:
setValueFrom in interface SCO
Parameters:
o - The Object
forUpdate - Whether to update the datastore with this value

unsetOwner

public void unsetOwner()
Utility to unset the owner.

Specified by:
unsetOwner in interface SCO

getOwner

public java.lang.Object getOwner()
Accessor for the owner.

Specified by:
getOwner in interface SCO
Returns:
The owner

getFieldName

public java.lang.String getFieldName()
Accessor for the field name

Specified by:
getFieldName in interface SCO
Returns:
The field name

makeDirty

public void makeDirty()
Utility to mark the object as dirty


runReachability

public void runReachability(java.util.Set reachables)
Method to run reachability on this SCO.

Specified by:
runReachability in interface SCO
Parameters:
reachables - List of StateManagers reachable so far

makeTransient

public void makeTransient(FetchPlanState state)
Method to make transient this object.

Specified by:
makeTransient in interface SCO
Parameters:
state - State for the fetchplan process

detach

public void detach(FetchPlanState state)
Method to detach this object.

Specified by:
detach in interface SCO
Parameters:
state - State for the detachment process

detachCopy

public java.lang.Object detachCopy(FetchPlanState state)
Method to detach a copy of this object.

Specified by:
detachCopy in interface SCO
Parameters:
state - State for detachment process
Returns:
The detached object

attachCopy

public void attachCopy(java.lang.Object value)
Method to attach the passed value.

Specified by:
attachCopy in interface SCO
Parameters:
value - The new value

writeReplace

protected java.lang.Object writeReplace()
                                 throws java.io.ObjectStreamException
The writeReplace method is called when ObjectOutputStream is preparing to write the object to the stream. The ObjectOutputStream checks whether the class defines the writeReplace method. If the method is defined, the writeReplace method is called to allow the object to designate its replacement in the stream. The object returned should be either of the same type as the object passed in or an object that when read and resolved will result in an object of a type that is compatible with all references to the object.

Returns:
the replaced object
Throws:
java.io.ObjectStreamException


Copyright © -2007 . All Rights Reserved.