objects
Class EuObject

java.lang.Object
  |
  +--objects.EuObject
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
EuParametrized, EuPoint, EuRadius

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

An abstract class from which the concrete EuObject classes are derived.


Field Summary
protected  int infoHash
          The hash code of the last mouseInfo used when displaying this object
 java.lang.String provenience
          String describing how the objected was constructed.
protected static double scaledown
          Constant value used when choose random points.
 
Constructor Summary
EuObject()
          Constructor does nothing
 
Method Summary
abstract  boolean castIdentical(objects.EuObject other)
          Determines whether or not another object is derived from the same full object of th epresent one, i.e. whether they are equal (up to a small error, see EuReal) in themselves, or possibly just after being cast to full circles or full lines
 objects.EuObject cloneObject()
          Clone the present object
abstract  boolean closureContains(fundamentals.EuVector point)
          Determines whether or not a given point is contained in the closure of the present object (up to a small error, see EuReal).
protected abstract  objects.plotCollection computeClip(fundamentals.mouseInfo info)
          Compute the visible portion of the object as a collection of arcs, intervals or points.
abstract  double confusionDistance(objects.EuObject other)
          Returns the distance from this object to another under these simplifications: The distance to lines or circles is in {0,POSITIVE_INFINITY} unless this is a point.
abstract  double distance(fundamentals.EuVector point)
          Returns the distance from the point on the object closest to a specified point, or Double.POSITIVE_INFINITY if this does not make sense (for instance in case of a EuRadius.
 void draw(java.awt.Graphics g, fundamentals.mouseInfo info)
          Describe draw method here.
 boolean equals(java.lang.Object other)
          Compares EuObjects in a mathematical sense: returns true if they are equal up to a reasonable error (see EuReal).
 objects.plotCollection getClip(fundamentals.mouseInfo info)
          Represent the visible portion of the object as a collection of arcs, intervals or points.
abstract  boolean interiorContains(fundamentals.EuVector point)
          Determines whether or not a given point is contained in the interior the present object (up to a small error, see EuReal).
abstract  boolean isFull()
          Return true if the item is of type R, L, C, or P
 boolean isVisible(fundamentals.mouseInfo info)
          Determine if object is currently visible on screen
 boolean mouseVicinity(int x, int y, fundamentals.mouseInfo info)
          Determines whether or not the mouse is close (in a sense determined in mouseVector) to the object's representation on screen.
 boolean mouseVicinity(fundamentals.mouseVector mouseAt, fundamentals.mouseInfo info)
          Determines whether or not the mouse is close (in a sense determined in mouseVector) to the object's representation on screen.
abstract  double nameDisplacementAngle(fundamentals.mouseInfo info)
          Used for locating labels for the object on screen
abstract  fundamentals.EuVector nameLocation(fundamentals.mouseInfo info)
          Used for locating labels for the object on screen
abstract  boolean overlaps(objects.EuObject other)
          Determines whether or not another object overlaps nontrivially with the present one, i.e. whether they have an intersection (up to a small error, see EuReal) with infinitely many points.
 java.lang.String params()
          Generate a mathematical specification of parameters associated to the object.
abstract  void passArguments(fundamentals.EuArguments args)
          Read off parameters describing the object and add to passed EuArguments instance
abstract  java.lang.String toNaturalLanguage(int language, boolean determined)
          Generate a description of the object in a natural language (Danish or English)
 void toPs(java.lang.StringBuffer work, fundamentals.mouseInfo info)
          Describe toPs method here.
abstract  java.lang.String toString()
          Generate a mathematical specification of the object.
abstract  char typeName()
          One of the letters A, C, H, I, L, P, R describing the type of object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

scaledown

protected static final double scaledown
Constant value used when choose random points. Smaller value would give random points closer to the displayed center.

See Also:
Constant Field Values

provenience

public java.lang.String provenience
String describing how the objected was constructed.


infoHash

protected int infoHash
The hash code of the last mouseInfo used when displaying this object

Constructor Detail

EuObject

public EuObject()
Constructor does nothing

Method Detail

equals

public boolean equals(java.lang.Object other)
Compares EuObjects in a mathematical sense: returns true if they are equal up to a reasonable error (see EuReal). Overrides Object method. Warning: This is not truly an equivalence relation! It will be reflexive and symmetric, but could fail to be transitive for roundoff error reasons. Will compare OWS' to EuObjects as though they were EuObjects.

Overrides:
equals in class java.lang.Object
Parameters:
other - the other EuObject
Returns:
a boolean value

getClip

public objects.plotCollection getClip(fundamentals.mouseInfo info)
                               throws InternalException,
                                      DesignException,
                                      UserException
Represent the visible portion of the object as a collection of arcs, intervals or points. Reuses stored data if possible.

Parameters:
info - information used in scaling and positioning the object
Returns:
a plotCollection value
Throws:
InternalException - if an error occurs
DesignException - if an error occurs
UserException - if an error occurs

draw

public void draw(java.awt.Graphics g,
                 fundamentals.mouseInfo info)
          throws InternalException,
                 DesignException,
                 UserException
Describe draw method here.

Parameters:
g - a Graphics value
info - a mouseInfo value
Throws:
InternalException - if an error occurs
DesignException - if an error occurs
UserException - if an error occurs

toPs

public void toPs(java.lang.StringBuffer work,
                 fundamentals.mouseInfo info)
          throws InternalException,
                 DesignException,
                 UserException
Describe toPs method here.

Parameters:
work - a StringBuffer value
info - a mouseInfo value
Throws:
InternalException - if an error occurs
DesignException - if an error occurs
UserException - if an error occurs

computeClip

protected abstract objects.plotCollection computeClip(fundamentals.mouseInfo info)
                                               throws InternalException,
                                                      DesignException,
                                                      UserException
Compute the visible portion of the object as a collection of arcs, intervals or points.

Parameters:
info - information used in scaling and positioning the object
Returns:
a plotCollection value
Throws:
InternalException - if an error occurs
DesignException - if an error occurs
UserException - if an error occurs

mouseVicinity

public boolean mouseVicinity(fundamentals.mouseVector mouseAt,
                             fundamentals.mouseInfo info)
                      throws InternalException,
                             DesignException,
                             UserException
Determines whether or not the mouse is close (in a sense determined in mouseVector) to the object's representation on screen.

Parameters:
mouseAt - The coordinates of the mouse position
info - information used in locating the object on screen
Returns:
true if the mouse is close
Throws:
InternalException - if an error occurs
DesignException - if an error occurs
UserException - if an error occurs

mouseVicinity

public boolean mouseVicinity(int x,
                             int y,
                             fundamentals.mouseInfo info)
                      throws InternalException,
                             DesignException,
                             UserException
Determines whether or not the mouse is close (in a sense determined in mouseVector) to the object's representation on screen.

Parameters:
x - The x-coordinate of the mouse position
y - The y-coordinate of the mouse position
info - information used in locating the object on screen
Returns:
true if the mouse is close
Throws:
InternalException - if an error occurs
DesignException - if an error occurs
UserException - if an error occurs

castIdentical

public abstract boolean castIdentical(objects.EuObject other)
Determines whether or not another object is derived from the same full object of th epresent one, i.e. whether they are equal (up to a small error, see EuReal) in themselves, or possibly just after being cast to full circles or full lines

Parameters:
other - the object being compared to the present one
Returns:
true if they are equal

interiorContains

public abstract boolean interiorContains(fundamentals.EuVector point)
Determines whether or not a given point is contained in the interior the present object (up to a small error, see EuReal).

Parameters:
point - the point being compared to the present object
Returns:
true if the point is contained

closureContains

public abstract boolean closureContains(fundamentals.EuVector point)
Determines whether or not a given point is contained in the closure of the present object (up to a small error, see EuReal).

Parameters:
point - the point being compared to the present object
Returns:
true if the point is contained

overlaps

public abstract boolean overlaps(objects.EuObject other)
Determines whether or not another object overlaps nontrivially with the present one, i.e. whether they have an intersection (up to a small error, see EuReal) with infinitely many points.

Parameters:
other - the object being compared to the present one
Returns:
true if they have an overlap

distance

public abstract double distance(fundamentals.EuVector point)
Returns the distance from the point on the object closest to a specified point, or Double.POSITIVE_INFINITY if this does not make sense (for instance in case of a EuRadius.

Parameters:
point - the point
Returns:
the parameter or zero

confusionDistance

public abstract double confusionDistance(objects.EuObject other)
Returns the distance from this object to another under these simplifications: The distance to lines or circles is in {0,POSITIVE_INFINITY} unless this is a point. The distance to radii is POSITIVE_INFINITY unless this is a radius The distance to points is POSITIVE_INFINITY if this is a radius

Parameters:
other - an EuObject value
Returns:
the parameter or zero

typeName

public abstract char typeName()
One of the letters A, C, H, I, L, P, R describing the type of object

Returns:
A, C, H, I, L, P, R

cloneObject

public objects.EuObject cloneObject()
Clone the present object

Returns:
a clone of the present object

isFull

public abstract boolean isFull()
Return true if the item is of type R, L, C, or P

Returns:
true if the item is of type RLCP

params

public java.lang.String params()
Generate a mathematical specification of parameters associated to the object.

Returns:
A string containing a list of parameters associated to the object

toString

public abstract java.lang.String toString()
Generate a mathematical specification of the object.

Overrides:
toString in class java.lang.Object
Returns:
A string containing a description of the object

passArguments

public abstract void passArguments(fundamentals.EuArguments args)
Read off parameters describing the object and add to passed EuArguments instance

Parameters:
args - an EuArguments value

toNaturalLanguage

public abstract java.lang.String toNaturalLanguage(int language,
                                                   boolean determined)
Generate a description of the object in a natural language (Danish or English)

Parameters:
language - Globals.DANISH or Globals.ENGLISH
determined - true for a determined noun (the line, linjen)
Returns:
a String value

isVisible

public final boolean isVisible(fundamentals.mouseInfo info)
                        throws InternalException,
                               DesignException,
                               UserException
Determine if object is currently visible on screen

Parameters:
info - a mouseInfo value
Returns:
true if object is currently visible on screen
Throws:
InternalException - if an error occurs
DesignException - if an error occurs
UserException - if an error occurs

nameDisplacementAngle

public abstract double nameDisplacementAngle(fundamentals.mouseInfo info)
Used for locating labels for the object on screen

Parameters:
info - a mouseInfo value
Returns:
a double value

nameLocation

public abstract fundamentals.EuVector nameLocation(fundamentals.mouseInfo info)
Used for locating labels for the object on screen

Parameters:
info - a mouseInfo value
Returns:
an EuVector value