Package com.cedarsoftware.ncube.proximity

Examples of com.cedarsoftware.ncube.proximity.Point3D


                Matcher m = Regexes.valid3Doubles.matcher((String) value);
                if (!m.matches())
                {
                    throw new IllegalArgumentException(String.format("Illegal Point3D value (%s)", value));
                }
                return new Point3D(Double.parseDouble(m.group(1)), Double.parseDouble(m.group(2)), Double.parseDouble(m.group(3)));
            }
            else
            {
                throw new IllegalArgumentException("Unknown value (" + type + ") for 'type' field");
            }
View Full Code Here


                    }

                    m = Regexes.valid3Doubles.matcher((String) value);
                    if (m.matches())
                    {
                        return new Point3D(getDouble(m.group(1)), getDouble(m.group(2)), getDouble(m.group(3)));
                    }

                    try
                    {   // Try as JSON
                        return (Comparable) JsonReader.jsonToJava((String) value);
View Full Code Here

                Matcher m = Regexes.valid3Doubles.matcher((String) value);
                if (!m.matches())
                {
                    throw new IllegalArgumentException(String.format("Illegal Point3D value (%s)", value));
                }
                return new Point3D(Double.parseDouble(m.group(1)), Double.parseDouble(m.group(2)), Double.parseDouble(m.group(3)));
            }
            else
            {
                throw new IllegalArgumentException("Unknown value (" + type + ") for 'type' field");
            }
View Full Code Here

            String twoDoubleFormat = "\"%f,%f\"";
            builder.append(String.format(twoDoubleFormat, l.getX(), l.getY()));
        }
        else if (o instanceof Point3D)
        {
            Point3D p = (Point3D)o;
            builder.append(String.format("\"%f,%f,%f\"", p.getX(), p.getY(), p.getZ()));
        }
        else if (o instanceof Range)
        {
            Range r = (Range)o;
            startArray();
View Full Code Here

                Matcher m = Regexes.valid3Doubles.matcher((String) value);
                if (!m.matches())
                {
                    throw new IllegalArgumentException(String.format("Illegal Point3D value (%s)", value));
                }
                return new Point3D(Double.parseDouble(m.group(1)), Double.parseDouble(m.group(2)), Double.parseDouble(m.group(3)));
            }
            else
            {
                throw new IllegalArgumentException("Unknown value (" + type + ") for 'type' field");
            }
View Full Code Here

            String twoDoubleFormat = "\"%f,%f\"";
            builder.append(String.format(twoDoubleFormat, l.getX(), l.getY()));
        }
        else if (o instanceof Point3D)
        {
            Point3D p = (Point3D)o;
            builder.append(String.format("\"%f,%f,%f\"", p.getX(), p.getY(), p.getZ()));
        }
        else if (o instanceof Range)
        {
            Range r = (Range)o;
            startArray();
View Full Code Here

                Matcher m = Regexes.valid3Doubles.matcher((String) val);
                if (!m.matches())
                {
                    throw new IllegalArgumentException(String.format("Illegal Point3D value (%s)", val));
                }
                return new Point3D(Double.parseDouble(m.group(1)), Double.parseDouble(m.group(2)), Double.parseDouble(m.group(3)));
            }
            else
            {
                throw new IllegalArgumentException("Unknown value (" + type + ") for 'type' field");
            }
View Full Code Here

            builder.append(pt.toString());
            builder.append('"');
        }
        else if (o instanceof Point3D)
        {
            Point3D pt = (Point3D)o;
            builder.append('"');
            builder.append(pt.toString());
            builder.append('"');
        }
        else if (o instanceof Range)
        {
            Range r = (Range)o;
View Full Code Here

            String twoDoubleFormat = "\"%f,%f\"";
            builder.append(String.format(twoDoubleFormat, l.getX(), l.getY()));
        }
        else if (o instanceof Point3D)
        {
            Point3D p = (Point3D)o;
            builder.append(String.format("\"%f,%f,%f\"", p.getX(), p.getY(), p.getZ()));
        }
        else if (o instanceof Range)
        {
            Range r = (Range)o;
            startArray();
View Full Code Here

                Matcher m = Regexes.valid3Doubles.matcher((String) value);
                if (!m.matches())
                {
                    throw new IllegalArgumentException(String.format("Illegal Point3D value (%s)", value));
                }
                return new Point3D(Double.parseDouble(m.group(1)), Double.parseDouble(m.group(2)), Double.parseDouble(m.group(3)));
            }
            else
            {
                throw new IllegalArgumentException("Unknown value (" + type + ") for 'type' field");
            }
View Full Code Here

TOP

Related Classes of com.cedarsoftware.ncube.proximity.Point3D

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.