Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.GeoPt


    public GeoPt decode(JsonReader reader, GeoPt defaultValue) {
        String latitude = reader.readProperty("latitude");
        String longitude = reader.readProperty("longitude");
        if(latitude != null && longitude != null){
            try{
                return new GeoPt(
                    Float.parseFloat(latitude)
                    , Float.parseFloat(longitude)
                    );
            } catch(NumberFormatException e){
            }
View Full Code Here


    public GeoPt decode(JsonReader reader, GeoPt defaultValue) {
        String latitude = reader.readProperty("latitude");
        String longitude = reader.readProperty("longitude");
        if(latitude != null && longitude != null){
            try{
                return new GeoPt(
                    Float.parseFloat(latitude)
                    , Float.parseFloat(longitude)
                    );
            } catch(NumberFormatException e){
            }
View Full Code Here

    public GeoPt decode(JsonReader reader, GeoPt defaultValue) {
        String latitude = reader.readProperty("latitude");
        String longitude = reader.readProperty("longitude");
        if(latitude != null && longitude != null){
            try{
                return new GeoPt(
                    Float.parseFloat(latitude)
                    , Float.parseFloat(longitude)
                    );
            } catch(NumberFormatException e){
            }
View Full Code Here

        m.setBlobListAttr(Arrays.asList(new Blob("hello".getBytes()), new Blob(
            "world".getBytes())));
        m.setCategoryListAttr(Arrays.asList(
            new Category("partOfSpeech"),
            new Category("kind")));
        m.setGeoPtListAttr(Arrays.asList(new GeoPt(1.0f, 2.0f), new GeoPt(
            3.0f,
            4.0f)));
        m.setImHandleListAttr(Arrays.asList(new IMHandle(
            IMHandle.Scheme.xmpp,
            "address"), new IMHandle(new URL("http://test"), "address")));
View Full Code Here

                .asList(new Category("partOfSpeech"), new Category("kind"))
                .toArray(),
            m.getCategoryListAttr().toArray());
        Assert.assertArrayEquals(
            Arrays
                .asList(new GeoPt(1.0f, 2.0f), new GeoPt(3.0f, 4.0f))
                .toArray(),
            m.getGeoPtListAttr().toArray());
        Assert.assertArrayEquals(
            Arrays.asList(
                new IMHandle(IMHandle.Scheme.xmpp, "address"),
View Full Code Here

        m.setKey(KeyFactory.createKey("test", 1000));
        m.setBlobKeyAttr(new BlobKey("Q3PqkweYlb4iWpp0BVw"));
        m.setCategoryAttr(new Category("partOfSpeech"));
        m.setEmailAttr(new Email("takawitter@test.com"));
        m.setBlobAttr(new Blob("hello".getBytes()));
        m.setGeoPtAttr(new GeoPt(10, 10));
        m.setImHandleAttr1(new IMHandle(IMHandle.Scheme.xmpp, "handle"));
        m.setImHandleAttr2(new IMHandle(new URL("http://aim.com"), "network"));
        m.setLinkAttr(new Link("link"));
        m.setPhoneNumberAttr(new PhoneNumber("000-0000-0000"));
        m.setPostalAddressAttr(new PostalAddress("address"));
View Full Code Here

        byte[] bytes = new byte[]{1,2,3};
        entity.setProperty("shortBlob", new ShortBlob(bytes ));
        entity.setProperty("user", new User("3@3.com", "domain", "id", "identity"));
        entity.setProperty("category", new Category("category"));
        entity.setProperty("email", new Email("3@3.com"));
        entity.setProperty("geopt", new GeoPt(23.0f, 54.3f));
        entity.setProperty("link", new Link("http://www.3.com"));
        entity.setProperty("phoneNumber", new PhoneNumber("333-333-3333"));
        entity.setProperty("postalAddress", new PostalAddress("333 three 3¬∫"));
        entity.setProperty("rating", new Rating(33));
        return entity;
View Full Code Here

      return ((DoublePropertyInfo) info).getPayload();
    case EMAIL:
      return new Email(((EmailPropertyInfo) info).getPayload());
    case GEOPT:
      GeoPtPropertyInfo geoPtInfo = (GeoPtPropertyInfo) info;
      return new GeoPt(geoPtInfo.getLatitude(), geoPtInfo.getLongitude());
    case IM_HANDLE:
      // TODO
      return null;
    case KEY:
      return DatastoreUtil.convert((KeyInfo)info);
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void testGeoPt() throws Exception {
    assertEquals(new GeoPt(1f, 2f),
        parser("geopt(1, 2)").bool_exp().e.evaluate(null).getPayload());
  }
View Full Code Here

    this.geoLocation = location;
  }

  public GeoPt getGeoLocation() {
    if(this.geoLocation == null) {
      this.geoLocation = new GeoPt(0.0F, 0.0F);
    }
    return this.geoLocation;
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.datastore.GeoPt

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.