NAME

SPVM::Point - Point

SYNOPSYS

use Point;

my $point = Point->new;
my $point = Point->new_xy(1, 2);

$point->set_x(1);
$point->set_y(2);

my $x = $point->x;
my $y = $point->y;

# (1,2)
my $stringable = (Stringable)$point;
my $point_string = $stringable->to_string;

DESCRIPTION

Point is a class for a point.

INTERFACES

Point class has the following interfaces.

CLASS METHODS

new

method new : Point ()

Create a new Point object.

new_xy

method new_xy : Point ($x : int, $y : int)

Create a new Point object with x and y.

INSTANCE METHODS

x

method x : int ()

Get x field.

set_x

void set_x : int ($x : int)

Set x field.

y

method y : int ();

Get y field.

set_y

void set_y : int ($y : int)

Set y field.

to_string

method to_string : string ();

Convert the Point object to a string as the following.

(1,2)

cloneable_clone

method cloneable_clone : object ()

Clone a Point object by create a new Point object and x and y fields are copied to the new object.