Package org.postgresql.util

Examples of org.postgresql.util.PGtokenizer


     * @param s Definition of this point in PostgreSQL's syntax
     * @exception SQLException on conversion failure
     */
    public void setValue(String s) throws SQLException
    {
        PGtokenizer t = new PGtokenizer(PGtokenizer.removePara(s), ',');
        try
        {
            x = Double.valueOf(t.getToken(0)).doubleValue();
            y = Double.valueOf(t.getToken(1)).doubleValue();
        }
        catch (NumberFormatException e)
        {
            throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH, e);
        }
View Full Code Here


     * @param s Definition of the polygon in PostgreSQL's syntax
     * @exception SQLException on conversion failure
     */
    public void setValue(String s) throws SQLException
    {
        PGtokenizer t = new PGtokenizer(PGtokenizer.removePara(s), ',');
        int npoints = t.getSize();
        points = new PGpoint[npoints];
        for (int p = 0;p < npoints;p++)
            points[p] = new PGpoint(t.getToken(p));
    }
View Full Code Here

     * @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));
    }
View Full Code Here

            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));
    }
View Full Code Here

     * @param s definition of the circle in PostgreSQL's syntax.
     * @exception SQLException on conversion failure
     */
    public void setValue(String s) throws SQLException
    {
        PGtokenizer t = new PGtokenizer(PGtokenizer.removeAngle(s), ',');
        if (t.getSize() != 2)
            throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH);

        try
        {
            center = new PGpoint(t.getToken(0));
            radius = Double.valueOf(t.getToken(1)).doubleValue();
        }
        catch (NumberFormatException e)
        {
            throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH, e);
        }
View Full Code Here

     * @param value a string representation of the value of the object
     * @exception SQLException thrown if value is invalid for this type
     */
    public void setValue(String value) throws SQLException
    {
        PGtokenizer t = new PGtokenizer(value, ',');
        if (t.getSize() != 2)
            throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,value}), PSQLState.DATA_TYPE_MISMATCH);

        point[0] = new PGpoint(t.getToken(0));
        point[1] = new PGpoint(t.getToken(1));
    }
View Full Code Here

     * @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));
    }
View Full Code Here

            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));
    }
View Full Code Here

     * @param s definition of the circle in PostgreSQL's syntax.
     * @exception SQLException on conversion failure
     */
    public void setValue(String s) throws SQLException
    {
        PGtokenizer t = new PGtokenizer(PGtokenizer.removeAngle(s), ',');
        if (t.getSize() != 2)
            throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH);

        try
        {
            center = new PGpoint(t.getToken(0));
            radius = Double.parseDouble(t.getToken(1));
        }
        catch (NumberFormatException e)
        {
            throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,s}), PSQLState.DATA_TYPE_MISMATCH, e);
        }
View Full Code Here

     * @param value a string representation of the value of the object
     * @exception SQLException thrown if value is invalid for this type
     */
    public void setValue(String value) throws SQLException
    {
        PGtokenizer t = new PGtokenizer(value, ',');
        if (t.getSize() != 2)
            throw new PSQLException(GT.tr("Conversion to type {0} failed: {1}.", new Object[]{type,value}), PSQLState.DATA_TYPE_MISMATCH);

        point[0] = new PGpoint(t.getToken(0));
        point[1] = new PGpoint(t.getToken(1));
    }
View Full Code Here

TOP

Related Classes of org.postgresql.util.PGtokenizer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.