~ubuntu-branches/ubuntu/wily/libpgjava/wily

« back to all changes in this revision

Viewing changes to src/interfaces/jdbc/org/postgresql/geometric/PGline.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2005-04-21 14:25:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050421142511-wibh5vc31fkrorx7
Tags: 7.4.7-3
Built with sources...

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * PGline.java
 
4
 *     This implements a line consisting of two points.
 
5
 *
 
6
 * Copyright (c) 2003, PostgreSQL Global Development Group
 
7
 *
 
8
 * IDENTIFICATION
 
9
 *        $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/geometric/Attic/PGline.java,v 1.5 2003/09/13 04:02:15 barry Exp $
 
10
 *
 
11
 *-------------------------------------------------------------------------
 
12
 */
1
13
package org.postgresql.geometric;
2
14
 
3
 
import java.io.*;
4
 
import java.sql.*;
5
 
import org.postgresql.util.*;
 
15
import org.postgresql.util.PGobject;
 
16
import org.postgresql.util.PGtokenizer;
 
17
import org.postgresql.util.PSQLException;
 
18
import org.postgresql.util.PSQLState;
 
19
 
 
20
import java.io.Serializable;
 
21
import java.sql.SQLException;
6
22
 
7
23
/*
8
 
 * This implements a line consisting of two points.
9
 
 *
10
24
 * Currently line is not yet implemented in the backend, but this class
11
25
 * ensures that when it's done were ready for it.
12
26
 */
65
79
        {
66
80
                PGtokenizer t = new PGtokenizer(PGtokenizer.removeBox(s), ',');
67
81
                if (t.getSize() != 2)
68
 
                        throw new PSQLException("postgresql.geo.line", s);
 
82
                        throw new PSQLException("postgresql.geo.line", PSQLState.DATA_TYPE_MISMATCH, s);
69
83
 
70
84
                point[0] = new PGpoint(t.getToken(0));
71
85
                point[1] = new PGpoint(t.getToken(1));