Top Description Fields Constructors Methods
org.postgresql.geometric

public Class PGline

extends PGobject
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Imports
org.postgresql.util.GT, .PGobject, .PGtokenizer, .PSQLException, .PSQLState, org.checkerframework.checker.nullness.qual.Nullable, java.io.Serializable, java.sql.SQLException

This implements a line represented by the linear equation Ax + By + C = 0.

Field Summary

Modifier and TypeField and Description
public double
a

Coefficient of x.

public double
b

Coefficient of y.

public double
c

Constant.

private boolean
Inherited from org.postgresql.util.PGobject:
typevalue

Constructor Summary

AccessConstructor and Description
public
PGline(double
coefficient of x
a
,
double
coefficient of y
b
,
double
constant
c
)

public
PGline(double
coordinate for first point on the line
x1
,
double
coordinate for first point on the line
y1
,
double
coordinate for second point on the line
x2
,
double
coordinate for second point on the line
y2
)

public
PGline(@Nullable PGpoint
first point on the line
p1
,
@Nullable PGpoint
second point on the line
p2
)

public
PGline(@Nullable PGlseg
Line segment which calls on this line.
lseg
)

public
PGline(String
definition of the line in PostgreSQL's syntax.
s
)

public
PGline()

required by the driver.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides org.postgresql.util.PGobject.clone.

This must be overridden to allow the object to be cloned.

public boolean

Returns:

true if the two lines are identical
equals
(@Nullable Object
Object to compare with
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public @Nullable String

Returns:

the PGline in the syntax expected by org.postgresql
getValue
()

Overrides org.postgresql.util.PGobject.getValue.

This must be overridden, to return the value of the object, in the form required by org.postgresql.

public int
private void
private void
setValue(double x1, double y1, double x2, double y2)

public void
setValue(@Nullable String
Definition of the line in PostgreSQL's syntax
s
)

Inherited from org.postgresql.util.PGobject:
equalsequalsgetTypeisNullsetTypesetValuetoString

Field Detail

aback to summary
public double a

Coefficient of x.

bback to summary
public double b

Coefficient of y.

cback to summary
public double c

Constant.

isNullback to summary
private boolean isNull

Constructor Detail

PGlineback to summary
public PGline(double a, double b, double c)
Parameters
a:double

coefficient of x

b:double

coefficient of y

c:double

constant

PGlineback to summary
public PGline(double x1, double y1, double x2, double y2)
Parameters
x1:double

coordinate for first point on the line

y1:double

coordinate for first point on the line

x2:double

coordinate for second point on the line

y2:double

coordinate for second point on the line

Annotations
@SuppressWarnings:method.invocation
PGlineback to summary
public PGline(@Nullable PGpoint p1, @Nullable PGpoint p2)
Parameters
p1:@Nullable PGpoint

first point on the line

p2:@Nullable PGpoint

second point on the line

Annotations
@SuppressWarnings:method.invocation
PGlineback to summary
public PGline(@Nullable PGlseg lseg)
Parameters
lseg:@Nullable PGlseg

Line segment which calls on this line.

Annotations
@SuppressWarnings:method.invocation
PGlineback to summary
public PGline(String s) throws SQLException
Parameters
s:String

definition of the line in PostgreSQL's syntax.

Annotations
@SuppressWarnings:method.invocation
Exceptions
SQLException:
on conversion failure
PGlineback to summary
public PGline()

required by the driver.

Method Detail

cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides org.postgresql.util.PGobject.clone.

Doc from org.postgresql.util.PGobject.clone.

This must be overridden to allow the object to be cloned.

Returns:Object

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
Exceptions
CloneNotSupportedException:

Doc from java.lang.Object.clone.

if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

equalsback to summary
public boolean equals(@Nullable Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:@Nullable Object

Object to compare with

Returns:boolean

true if the two lines are identical

Annotations
@Override
getValueback to summary
public @Nullable String getValue()

Overrides org.postgresql.util.PGobject.getValue.

Doc from org.postgresql.util.PGobject.getValue.

This must be overridden, to return the value of the object, in the form required by org.postgresql.

Returns:@Nullable String

the PGline in the syntax expected by org.postgresql

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides org.postgresql.util.PGobject.hashCode.

Doc from org.postgresql.util.PGobject.hashCode.

Compute hash. As equals() use only value. Return the same hash for the same value.

Returns:int

Value hashcode, 0 if value is null java.util.Objects#hashCode(Object)

Annotations
@Override
setValueback to summary
private void setValue(@Nullable PGpoint p1, @Nullable PGpoint p2)
setValueback to summary
private void setValue(double x1, double y1, double x2, double y2)
setValueback to summary
public void setValue(@Nullable String s) throws SQLException
Parameters
s:@Nullable String

Definition of the line in PostgreSQL's syntax

Annotations
@Override
Exceptions
SQLException:
on conversion failure