FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | FIELD | ACTION | DETAIL: IMPORT | CONSTANT | FIELD | ACTION |
location(x1, y1, x2, y2)An example of a valid location therefore looks as follows:
location(15.23, 24.234, 19.1232, 28.873)A point can be represented simply as a rectangle with both corners being the same point. You can access the data members of a location type in the same way that you access the fields of an event. For example:
location l := location(1.0, 2.0, 3.0, 4.0);This prints 1.0. You can use a location type to describe a rectangular area but you can also use it to describe various other quantities, such as line segments connecting two endpoints, circles, vectors, or points in a four-dimensional space. However, certain inbuilt methods, such as the inside() method, give correct results only for boundary rectangles.
print l.x1.toString();
location l := location(0.0, 0.0, 1.0, 1.0);Locations can be parsed, routed and compared. They are not cyclic.
on all A(loc = l) ...
Field summary | |
---|---|
float | x1 The x component of the first point. |
float | y1 The y component of the first point. |
float | x2 The x component of the second point. |
float | y2 The y component of the second point. |
Action summary | |
---|---|
boolean | static canParse(string s) Check if the string argument can be successfully parsed as a location. |
location | static parse(string s) Parse a string as a location. |
location |
clone() Create a copy of this location. |
location |
expand(float size) Return a new location from this location expanded by the specified amount. |
integer |
hash() Get an integer hash representation of the underlying object. |
boolean |
inside(location enclosing) Check whether this location is entirely within another location. |
string |
toString() Return the string form of this location. |
Field detail |
---|
float x1The x component of the first point.
float x2The x component of the second point.
float y1The y component of the first point.
float y2The y component of the second point.
Action detail |
---|
boolean static canParse(string s)Check if the string argument can be successfully parsed as a location.
location static parse(string s)Parse a string as a location.
location clone()Create a copy of this location.
location expand(float size)Return a new location from this location expanded by the specified amount.
integer hash()Get an integer hash representation of the underlying object.
boolean inside(location enclosing)Check whether this location is entirely within another location.
string toString()Return the string form of this location.
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | FIELD | ACTION | DETAIL: IMPORT | CONSTANT | FIELD | ACTION |