/** * @param s Definition of the path in PostgreSQL's syntax * @throws SQLException on conversion failure */ public void setValue(String s) throws SQLException { // First test to see if were open if (s.startsWith("[") && s.endsWith("]")) { open = true; s = PGtokenizer.removeBox(s); } else if (s.startsWith("(") && s.endsWith(")")) { open = false; s = PGtokenizer.removePara(s); } else { throw new PSQLException(GT.tr("Cannot tell if path is open or closed: {0}.", s), PSQLState.DATA_TYPE_MISMATCH); } PGtokenizer t = new PGtokenizer(s, ','); int npoints = t.getSize(); points = new PGpoint[npoints]; for (int p = 0; p < npoints; p++) { points[p] = new PGpoint(t.getToken(p)); } }
/** * @param s Definition of the path in PostgreSQL's syntax * @exception SQLException on conversion failure */ public void setValue(String s) throws SQLException { // First test to see if were open if (s.startsWith("[") && s.endsWith("]")) { open = true; s = PGtokenizer.removeBox(s); } else if (s.startsWith("(") && s.endsWith(")")) { open = false; s = PGtokenizer.removePara(s); } else throw new PSQLException(GT.tr("Cannot tell if path is open or closed: {0}.", s), PSQLState.DATA_TYPE_MISMATCH); PGtokenizer t = new PGtokenizer(s, ','); int npoints = t.getSize(); points = new PGpoint[npoints]; for (int p = 0;p < npoints;p++) points[p] = new PGpoint(t.getToken(p)); }
/** * @param s Definition of the line in PostgreSQL's syntax * @throws SQLException on conversion failure */ @Override public void setValue(String s) throws SQLException { if (s.trim().startsWith("{")) { PGtokenizer t = new PGtokenizer(PGtokenizer.removeCurlyBrace(s), ','); if (t.getSize() != 3) { throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", type, s), PSQLState.DATA_TYPE_MISMATCH); } a = Double.parseDouble(t.getToken(0)); b = Double.parseDouble(t.getToken(1)); c = Double.parseDouble(t.getToken(2)); } else if (s.trim().startsWith("[")) { PGtokenizer t = new PGtokenizer(PGtokenizer.removeBox(s), ','); if (t.getSize() != 2) { throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", type, s), PSQLState.DATA_TYPE_MISMATCH); } PGpoint point1 = new PGpoint(t.getToken(0)); PGpoint point2 = new PGpoint(t.getToken(1)); a = point2.x - point1.x; b = point2.y - point1.y; c = point1.y; } }
/** * @param s Definition of the line 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(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH); point[0] = new PGpoint(t.getToken(0)); point[1] = new PGpoint(t.getToken(1)); }
/** * @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(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH); point[0] = new PGpoint(t.getToken(0)); point[1] = new PGpoint(t.getToken(1)); }
/** * @param s Definition of the line segment in PostgreSQL's syntax * @throws SQLException on conversion failure */ @Override public void setValue(String s) throws SQLException { PGtokenizer t = new PGtokenizer(PGtokenizer.removeBox(s), ','); if (t.getSize() != 2) { throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", type, s), PSQLState.DATA_TYPE_MISMATCH); } point[0] = new PGpoint(t.getToken(0)); point[1] = new PGpoint(t.getToken(1)); }
/** * @param s Definition of the path in PostgreSQL's syntax * @exception SQLException on conversion failure */ public void setValue(String s) throws SQLException { // First test to see if were open if (s.startsWith("[") && s.endsWith("]")) { open = true; s = PGtokenizer.removeBox(s); } else if (s.startsWith("(") && s.endsWith(")")) { open = false; s = PGtokenizer.removePara(s); } else throw new PSQLException(GT.tr("Cannot tell if path is open or closed: {0}.", s), PSQLState.DATA_TYPE_MISMATCH); PGtokenizer t = new PGtokenizer(s, ','); int npoints = t.getSize(); points = new PGpoint[npoints]; for (int p = 0;p < npoints;p++) points[p] = new PGpoint(t.getToken(p)); }
/** * @param s Definition of the path in PostgreSQL's syntax * @exception SQLException on conversion failure */ public void setValue(String s) throws SQLException { // First test to see if were open if (s.startsWith("[") && s.endsWith("]")) { open = true; s = PGtokenizer.removeBox(s); } else if (s.startsWith("(") && s.endsWith(")")) { open = false; s = PGtokenizer.removePara(s); } else throw new PSQLException(GT.tr("Cannot tell if path is open or closed: {0}.", s), PSQLState.DATA_TYPE_MISMATCH); PGtokenizer t = new PGtokenizer(s, ','); int npoints = t.getSize(); points = new PGpoint[npoints]; for (int p = 0;p < npoints;p++) points[p] = new PGpoint(t.getToken(p)); }
/** * @param s Definition of the line 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(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH); point[0] = new PGpoint(t.getToken(0)); point[1] = new PGpoint(t.getToken(1)); }
/** * @param s Definition of the line 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(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH); point[0] = new PGpoint(t.getToken(0)); point[1] = new PGpoint(t.getToken(1)); }
/** * @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(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH); point[0] = new PGpoint(t.getToken(0)); point[1] = new PGpoint(t.getToken(1)); }
/** * @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(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH); point[0] = new PGpoint(t.getToken(0)); point[1] = new PGpoint(t.getToken(1)); }