Examples of Atom


Examples of org.jmol.adapter.smarter.Atom

      float x = parseFloat(line, 8, 25);
      float y = parseFloat(line, 25, 40);
      float z = parseFloat(line, 40, 56);
      if (Float.isNaN(x) || Float.isNaN(y) || Float.isNaN(z))
        break;
      Atom atom = atomSetCollection.addNewAtom();
      atom.atomName = atomName + (++atomCountInFirstModel);
      atom.set(x, y, z);
      atom.scale(ANGSTROMS_PER_BOHR);
      atomNames.add(atomName);
    }
  }
View Full Code Here

Examples of org.jmol.modelset.Atom

    // bsA.andNot(bsB);
    int atomIndex = modelSet.getAtomCount();
    int atomno = modelSet.getAtomCountInModel(modelIndex);
    StringBuffer sbConnect = new StringBuffer();
    for (int i = 0; i < vConnections.size(); i++) {
      Atom a = (Atom) vConnections.get(i);
      sbConnect.append(";  connect 0 100 ").append("({" + (atomIndex++) + "}) ")
          .append("({" + a.index + "});");
    }
    StringBuffer sb = new StringBuffer();
    sb.append(pts.length).append("\nViewer.AddHydrogens#noautobond");
View Full Code Here

Examples of org.nutz.trans.Atom

  public TransactionInterceptor(int level) {
    this.level = level;
  }

  public void filter(final InterceptorChain chain) {
    Trans.exec(level, new Atom() {
      public void run() {
        try {
          chain.doChain();
        }
        catch (Throwable e) {
View Full Code Here

Examples of org.nutz.trans.Atom

    final Context context = Lang.context("{num:0}");
    context.set("z", z);

    System.out.println("\n" + Strings.dup('=', 100));

    Stopwatch sw = Stopwatch.run(new Atom() {
      public void run() {
        int num = 0;
        for (int i = 0; i < max; i++)
          num = num + (i - 1 + 2 - 3 + 4 - 5 + 6 - 7) - z.abc(i);
        System.out.println("Num: " + num);
      }
    });

    System.out.println("\n" + Strings.dup('=', 100));
   
    Stopwatch sw3 = Stopwatch.run(new Atom() {
      public void run() {
        try {
          context.set("num", 0);
          for (int i = 0; i < max; i++)
            context.set("num", El.eval(context.set("i", i), elstr));
          System.out.println("Num: " + context.getInt("num"));
        }
        catch (Exception e) {
          throw Lang.wrapThrow(e);
        }
      }
    });
    System.out.println("\n" + Strings.dup('=', 100));
   
    Stopwatch sw4 = Stopwatch.run(new Atom() {
      public void run() {
        try {
          El el2pre = new El(elstr);
          context.set("num", 0);
          context.set("z", z);
          for (int i = 0; i < max; i++)
            context.set("num", el2pre.eval(context.set("i", i)));
          System.out.println("Num: " + context.getInt("num"));
        }
        catch (Exception e) {
          throw Lang.wrapThrow(e);
        }
      }
    });
    System.out.println("\n" + Strings.dup('=', 100));
   
    Stopwatch sw5 = Stopwatch.run(new Atom() {
      public void run() {
        try {
          El el2pre = new El(elstr);
          context.set("num", 0);
          context.set("z", z);
View Full Code Here

Examples of org.nutz.trans.Atom

  @Test
  public void test_insert_by_filter() {
    // insert one pet
    final Pet p = pet("xh").setNickName("XiaoHei");
    FieldFilter.create(Pet.class, "id|name").run(new Atom() {
      public void run() {
        dao.insert(p);
      }
    });
    Pet p2 = dao.fetch(Pet.class, p.getId());
View Full Code Here

Examples of org.nutz.trans.Atom

  @Test
  public void test_update_by_filter() {
    final Pet p = dao.fetch(Pet.class, "xb");
    p.setNickName("XiaoBai");
    FieldFilter.create(Pet.class, "id|name").run(new Atom() {
      public void run() {
        dao.update(p);
      }
    });
    Pet p2 = dao.fetch(Pet.class, p.getId());
View Full Code Here

Examples of org.nutz.trans.Atom

  @Test
  public void test_select_by_filter() {
    dao.update(dao.fetch(Pet.class, "xb").setNickName("XiaoBai"));
    assertEquals("XiaoBai", dao.fetch(Pet.class, "xb").getNickName());
    final Pet[] pets = new Pet[1];
    FieldFilter.create(Pet.class, "id|name").run(new Atom() {
      public void run() {
        pets[0] = dao.fetch(Pet.class, "xb");
      }
    });
    assertNull(pets[0].getNickName());
View Full Code Here

Examples of org.nutz.trans.Atom

  @Test
  public void test_query_by_filter() {
    dao.update(dao.fetch(Pet.class, "xb").setNickName("XiaoBai"));
    assertEquals("XiaoBai", dao.fetch(Pet.class, "xb").getNickName());
    final List<Pet> pets = new ArrayList<Pet>();
    FieldFilter.create(Pet.class, "id|name").run(new Atom() {
      public void run() {
        pets.add(dao.query(Pet.class, null, null).get(0));
      }
    });
    assertNull(pets.get(0).getNickName());
View Full Code Here

Examples of org.nutz.trans.Atom

  public void test_filter_no_field_match() {
    dao.create(EmtryObject.class, true);
    final EmtryObject obj = new EmtryObject();

    // 应该抛出一个DaoException,因为没有任何的字段需要插入!
    FieldFilter.create(EmtryObject.class, "id").run(new Atom() {
      public void run() {
        dao.insert(obj);
      }
    });
View Full Code Here

Examples of org.nutz.trans.Atom

    });
  }

  @Test
  public void delete_null_field_links() {
    TableName.run(platoon, new Atom() {
      public void run() {
        Platoon p = dao.fetchLinks(dao.fetch(Platoon.class), "tanks|soliders");
        dao.deleteLinks(p, "tanks|soliders");
        assertEquals(1, dao.count(Platoon.class));
        assertEquals(0, dao.count(Soldier.class));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.