fm.liveswitch.Point Class Reference

A point (x and y coordinates). More...

Public Member Functions

int getX ()
 Gets the X coordinate. More...
 
int getY ()
 Gets the Y coordinate. More...
 
boolean isEquivalent (fm.liveswitch.Point point)
 Determines whether the specified point is equivalent. More...
 
 Point ()
 Initializes a new instance of the fm.liveswitch.Point class. More...
 
 Point (int x, int y)
 Initializes a new instance of the fm.liveswitch.Point class. More...
 
void setX (int value)
 Sets the X coordinate. More...
 
void setY (int value)
 Sets the Y coordinate. More...
 
String toJson ()
 Serializes this instance to JSON. More...
 
String toString ()
 Returns a string that represents this instance using format "{x},{y}". More...
 

Static Public Member Functions

static fm.liveswitch.Point fromJson (String pointJson)
 Deserializes an instance from JSON. More...
 
static fm.liveswitch.Point getEmpty ()
 Gets the empty point (0,0). More...
 
static boolean isEquivalent (fm.liveswitch.Point point1, fm.liveswitch.Point point2)
 Determines whether the two points are equivalent. More...
 
static String toJson (final fm.liveswitch.Point point)
 Serializes an instance to JSON. More...
 

Detailed Description

A point (x and y coordinates).

Constructor & Destructor Documentation

◆ Point() [1/2]

fm.liveswitch.Point.Point ( )

Initializes a new instance of the fm.liveswitch.Point class.

◆ Point() [2/2]

fm.liveswitch.Point.Point ( int  x,
int  y 
)

Initializes a new instance of the fm.liveswitch.Point class.

Parameters
xThe X coordinate.
yThe Y coordinate.

Member Function Documentation

◆ fromJson()

static fm.liveswitch.Point fm.liveswitch.Point.fromJson ( String  pointJson)
static

Deserializes an instance from JSON.

Parameters
pointJsonThe JSON to deserialize.
Returns
The deserialized point.

◆ getEmpty()

static fm.liveswitch.Point fm.liveswitch.Point.getEmpty ( )
static

Gets the empty point (0,0).

◆ getX()

int fm.liveswitch.Point.getX ( )

Gets the X coordinate.

◆ getY()

int fm.liveswitch.Point.getY ( )

Gets the Y coordinate.

◆ isEquivalent() [1/2]

boolean fm.liveswitch.Point.isEquivalent ( fm.liveswitch.Point  point)

Determines whether the specified point is equivalent.

Parameters
pointThe point.

◆ isEquivalent() [2/2]

static boolean fm.liveswitch.Point.isEquivalent ( fm.liveswitch.Point  point1,
fm.liveswitch.Point  point2 
)
static

Determines whether the two points are equivalent.

Parameters
point1The first point.
point2The second point.

◆ setX()

void fm.liveswitch.Point.setX ( int  value)

Sets the X coordinate.

◆ setY()

void fm.liveswitch.Point.setY ( int  value)

Sets the Y coordinate.

◆ toJson() [1/2]

String fm.liveswitch.Point.toJson ( )

Serializes this instance to JSON.

Returns
The serialized JSON.

◆ toJson() [2/2]

static String fm.liveswitch.Point.toJson ( final fm.liveswitch.Point  point)
static

Serializes an instance to JSON.

Parameters
pointThe point.
Returns
The serialized JSON.

◆ toString()

String fm.liveswitch.Point.toString ( )

Returns a string that represents this instance using format "{x},{y}".