The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

SPVM::Point - Point

Usage

  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;
  
  my $point_string = $point->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.