|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--generator2.ExternalObject
Class representing an external object.
| Constructor Summary | |
ExternalObject(int id,
int time,
int lifetime,
int objClass,
int x,
int y,
int width,
int height)
Constructor. |
|
| Method Summary | |
void |
addToContainer(ExternalObjects container)
Adds the object to a container. |
double |
computeDistanceTo(int[] p)
Computes the distance to a given point. |
boolean |
contains(MBR rect)
Tests whether the object contains a given rectangle or not. |
void |
draw(java.awt.Graphics g,
int scale)
Draws the MBR of the object if it is exists at the actual time. |
long |
getId()
Returns the identifier of the external object. |
int |
getLayer()
Returns the layer of the object. |
MBR |
getMBR()
Returns the area. |
int |
getNumOfDimensions()
Returns the number of dimensions. |
int |
getObjectClass()
Returns the object class of the object. |
java.lang.Object |
getType()
Returns the class of the object as Integer. |
boolean |
interacts(int x,
int y,
int scale)
Tests whether an object is selected by a point or not. |
boolean |
intersects(MBR r)
Tests whether the object intersects a given rectangle. |
boolean |
intersects(java.lang.Object obj)
Tests whether the object intersects another object. |
boolean |
isAlive(int currTime)
Returns whether the object is alive or not. |
boolean |
isContainedBy(MBR rect)
Tests whether the object is contained by a given rectangle or not. |
boolean |
isContainedBy(SpatialSearchTreeEntry entry)
Tests whether the object is contained by a given entry or not. |
boolean |
isOfSameType(SpatialSearchTreeObject obj)
Tests whether the object is of the same type as the given object or not. |
boolean |
isVisible(double scale)
Test whether the external object is visible or not. |
boolean |
isVisible(int scale)
Tests whether the object is visible at a given scale or not. |
void |
reportDeletedObject(Reporter reporter,
int currTime)
Reports a deleted external object. |
void |
reportMovingObject(Reporter reporter,
int currTime)
Reports a moving external object. |
void |
reportNewObject(Reporter reporter)
Reports a new external object. |
void |
setMBR(MBR newMBR)
Sets the MBR of the object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ExternalObject(int id,
int time,
int lifetime,
int objClass,
int x,
int y,
int width,
int height)
id - the identifiertime - current timelifetime - lifetimeobjClass - id of the object classx - x-coordinatey - y-coordinatewidth - widthheight - height| Method Detail |
public void addToContainer(ExternalObjects container)
container - the containerpublic double computeDistanceTo(int[] p)
computeDistanceTo in interface SpatialSearchTreeObjectp - coordinates of the point
public boolean contains(MBR rect)
contains in interface SpatialSearchTreeObjectrect - the rectangle
public void draw(java.awt.Graphics g,
int scale)
draw in interface SpatialSearchTreeObjectg - graphic contextscale - actual scalepublic long getId()
getId in interface SpatialSearchTreeObjectpublic int getLayer()
getLayer in interface LayerSpatialSearchTreeObjectpublic MBR getMBR()
getMBR in interface SpatialSearchTreeEntrypublic int getNumOfDimensions()
getNumOfDimensions in interface SpatialSearchTreeEntrypublic int getObjectClass()
public java.lang.Object getType()
public boolean interacts(int x,
int y,
int scale)
x - x-coordinate of the pointy - y-coordinate of the pointscale - scale
public boolean intersects(java.lang.Object obj)
intersects in interface SpatialSearchTreeObjectobj - the object
public boolean intersects(MBR r)
intersects in interface SpatialSearchTreeObjectr - the rectangle
public boolean isAlive(int currTime)
currTime - the current time
public boolean isContainedBy(MBR rect)
isContainedBy in interface SpatialSearchTreeObjectrect - the rectangle
public boolean isContainedBy(SpatialSearchTreeEntry entry)
isContainedBy in interface SpatialSearchTreeObjectentry - the entry
public boolean isOfSameType(SpatialSearchTreeObject obj)
isOfSameType in interface SpatialSearchTreeObjectobj - the other object
public boolean isVisible(double scale)
scale - the current actual scale (negative value => returns true)
public boolean isVisible(int scale)
scale - scale
public void reportDeletedObject(Reporter reporter,
int currTime)
reporter - the reportercurrTime - the current time
public void reportMovingObject(Reporter reporter,
int currTime)
reporter - the reportercurrTime - the current timepublic void reportNewObject(Reporter reporter)
reporter - the reporterpublic void setMBR(MBR newMBR)
newMBR - the new MNR
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||