summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/postgresql/geometric/PGlseg.java
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-02-13 16:14:40 +0000
committerBruce Momjian <bruce@momjian.us>2001-02-13 16:14:40 +0000
commit934c5b841edb9fda9ef3d25196c3adaef6cdb935 (patch)
treed0dbf485aafc10b26ae14e48b678c77dede35ab6 /src/interfaces/jdbc/postgresql/geometric/PGlseg.java
parent730d1c0dd070055a17358f87ca463979d7e40eec (diff)
Remove postgresql jdbc files, per Peter Mount.
Diffstat (limited to 'src/interfaces/jdbc/postgresql/geometric/PGlseg.java')
-rw-r--r--src/interfaces/jdbc/postgresql/geometric/PGlseg.java100
1 files changed, 0 insertions, 100 deletions
diff --git a/src/interfaces/jdbc/postgresql/geometric/PGlseg.java b/src/interfaces/jdbc/postgresql/geometric/PGlseg.java
deleted file mode 100644
index 9fa133e4652..00000000000
--- a/src/interfaces/jdbc/postgresql/geometric/PGlseg.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package postgresql.geometric;
-
-import java.io.*;
-import java.sql.*;
-import postgresql.util.*;
-
-/**
- * This implements a lseg (line segment) consisting of two points
- */
-public class PGlseg extends PGobject implements Serializable,Cloneable
-{
- /**
- * These are the two points.
- */
- public PGpoint point[] = new PGpoint[2];
-
- /**
- * @param x1 coordinate for first point
- * @param y1 coordinate for first point
- * @param x2 coordinate for second point
- * @param y2 coordinate for second point
- */
- public PGlseg(double x1,double y1,double x2,double y2)
- {
- this(new PGpoint(x1,y1),new PGpoint(x2,y2));
- }
-
- /**
- * @param p1 first point
- * @param p2 second point
- */
- public PGlseg(PGpoint p1,PGpoint p2)
- {
- this();
- this.point[0] = p1;
- this.point[1] = p2;
- }
-
- /**
- * @param s definition of the circle in PostgreSQL's syntax.
- * @exception SQLException on conversion failure
- */
- public PGlseg(String s) throws SQLException
- {
- this();
- setValue(s);
- }
-
- /**
- * reuired by the driver
- */
- public PGlseg()
- {
- setType("lseg");
- }
-
- /**
- * @param s Definition of the line segment in PostgreSQL's syntax
- * @exception SQLException on conversion failure
- */
- public void setValue(String s) throws SQLException
- {
- PGtokenizer t = new PGtokenizer(PGtokenizer.removeBox(s),',');
- if(t.getSize() != 2)
- throw new PSQLException("postgresql.geo.lseg");
-
- point[0] = new PGpoint(t.getToken(0));
- point[1] = new PGpoint(t.getToken(1));
- }
-
- /**
- * @param obj Object to compare with
- * @return true if the two boxes are identical
- */
- public boolean equals(Object obj)
- {
- if(obj instanceof PGlseg) {
- PGlseg p = (PGlseg)obj;
- return (p.point[0].equals(point[0]) && p.point[1].equals(point[1])) ||
- (p.point[0].equals(point[1]) && p.point[1].equals(point[0]));
- }
- return false;
- }
-
- /**
- * This must be overidden to allow the object to be cloned
- */
- public Object clone()
- {
- return new PGlseg((PGpoint)point[0].clone(),(PGpoint)point[1].clone());
- }
-
- /**
- * @return the PGlseg in the syntax expected by postgresql
- */
- public String getValue()
- {
- return "["+point[0]+","+point[1]+"]";
- }
-}