com.amazon.redshift.geometric

## Class RedshiftLine

- java.lang.Object
- - com.amazon.redshift.util.RedshiftObject
  - - com.amazon.redshift.geometric.RedshiftLine

All Implemented Interfaces:
  Serializable, Cloneable

    public class RedshiftLine
    extends RedshiftObject
    implements Serializable, Cloneable

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

See Also:
  Serialized Form

### Field Summary

Fields
`double` `a` Coefficient of x.
`double` `b` Coefficient of y.
`double` `c` Constant.

### Fields inherited from class com.amazon.redshift.util.RedshiftObject

`type, value`

### Constructor Summary

Constructors
Constructor and Description
`RedshiftLine()` required by the driver.
`RedshiftLine(double a, double b, double c)`
`RedshiftLine(double x1, double y1, double x2, double y2)`
`RedshiftLine(RedshiftLseg lseg)`
`RedshiftLine(RedshiftPoint p1, RedshiftPoint p2)`
`RedshiftLine(String s)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Object` `clone()` This must be overidden to allow the object to be cloned.
`boolean` `equals(Object obj)` This must be overidden to allow comparisons of objects.
`String` `getValue()` This must be overidden, to return the value of the object, in the form required by com.amazon.redshift.
`int` `hashCode()` Compute hash.
`void` `setValue(String s)` This method sets the value of this object.

### Methods inherited from class com.amazon.redshift.util.RedshiftObject

`getType, setType, toString`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### a

    public double a

Coefficient of x.

#### b

    public double b

Coefficient of y.

#### c

    public double c

Constant.

### Constructor Detail

#### RedshiftLine

    public RedshiftLine(double a,
                        double b,
                        double c)

Parameters:
  `a` - coefficient of x
  `b` - coefficient of y
  `c` - constant

#### RedshiftLine

    public RedshiftLine(double x1,
                        double y1,
                        double x2,
                        double y2)

Parameters:
  `x1` - coordinate for first point on the line
  `y1` - coordinate for first point on the line
  `x2` - coordinate for second point on the line
  `y2` - coordinate for second point on the line

#### RedshiftLine

    public RedshiftLine(RedshiftPoint p1,
                        RedshiftPoint p2)

Parameters:
  `p1` - first point on the line
  `p2` - second point on the line

#### RedshiftLine

    public RedshiftLine(RedshiftLseg lseg)

Parameters:
  `lseg` - Line segment which calls on this line.

#### RedshiftLine

    public RedshiftLine(String s)
                 throws SQLException

Parameters:
  `s` - definition of the line in Redshift's syntax.
Throws:
  `SQLException` - on conversion failure

#### RedshiftLine

    public RedshiftLine()

required by the driver.

### Method Detail

#### setValue

    public void setValue(String s)
                  throws SQLException

Description copied from class: `RedshiftObject`
This method sets the value of this object. It must be overridden.

Overrides:
  `setValue` in class `RedshiftObject`
Parameters:
  `s` - Definition of the line in Redshift's syntax
Throws:
  `SQLException` - on conversion failure

#### equals

    public boolean equals(Object obj)

Description copied from class: `RedshiftObject`
This must be overidden to allow comparisons of objects.

Overrides:
  `equals` in class `RedshiftObject`
Parameters:
  `obj` - Object to compare with
Returns:
  true if the two lines are identical

#### hashCode

    public int hashCode()

Description copied from class: `RedshiftObject`
Compute hash. As equals() use only value. Return the same hash for the same value.

Overrides:
  `hashCode` in class `RedshiftObject`
Returns:
  Value hashcode, 0 if value is null `Objects.hashCode(Object)`

#### getValue

    public String getValue()

Description copied from class: `RedshiftObject`
This must be overidden, to return the value of the object, in the form required by com.amazon.redshift.

Overrides:
  `getValue` in class `RedshiftObject`
Returns:
  the RedshiftLine in the syntax expected by com.amazon.redshift

#### clone

    public Object clone()
                 throws CloneNotSupportedException

Description copied from class: `RedshiftObject`
This must be overidden to allow the object to be cloned.

Overrides:
  `clone` in class `RedshiftObject`
Throws:
  `CloneNotSupportedException`