Examples of Atom


Examples of clojure.lang.Atom

  private WorkerData workerData;
  private String componentType; //"spout" or "bolt"

  @SuppressWarnings("rawtypes")
  public Task(WorkerData workerData, int taskId) throws Exception {
    openOrPrepareWasCalled = new Atom(Boolean.valueOf(false));

    this.workerData = workerData;
    this.topologyContext = workerData.getContextMaker()
        .makeTopologyContext(workerData.getSysTopology(), taskId,
            openOrPrepareWasCalled);
View Full Code Here

Examples of com.knowgate.scheduler.Atom

                 oStm.setString(1, oSnd.getString(DB.gu_job));
                 oRst = oStm.executeQuery();
                 ResultSetMetaData oMdt = oRst.getMetaData();
                 boolean bHasNext = oRst.next();
                 while (bHasNext) {
                   Atom oAtm = new Atom(oRst, oMdt);
                   oAtm.replace(DB.id_format,sType);
                   try {                    
                     oSnd.process(oAtm);
                     oAtm.archive(oCon);                    
                     oCon.commit();
                     nSent++;
                     System.out.println("Mail number "+String.valueOf(oAtm.getInt(DB.pg_atom))+" "+oAtm.getString(DB.tx_email)+" sent OK");
                   } catch (SQLException sqle) {
                     nErrs++;
                     System.out.println("Mail number "+String.valueOf(oAtm.getInt(DB.pg_atom))+" "+oAtm.getString(DB.tx_email)+" failed with SQLException "+sqle.getMessage());
                     if (DebugFile.trace) DebugFile.writeln("SQLException at atom "+String.valueOf(oAtm.getInt(DB.pg_atom))+" "+sqle.getMessage()+" "+StackTraceUtil.getStackTrace(sqle));
                     try { oCon.rollback(); oAtm.setStatus(oCon, Atom.STATUS_INTERRUPTED, "SQLException "+sqle.getMessage()); oCon.commit(); } catch (SQLException ignore) { }
                     oRst.close(); oRst=null;
                    oStm.close(); oStm=null;
                     break;
                   } catch (NullPointerException npe) {
                     nErrs++;
                     System.out.println("Mail number "+String.valueOf(oAtm.getInt(DB.pg_atom))+" "+oAtm.getString(DB.tx_email)+" failed with NullPointerException "+npe.getMessage());
                     if (DebugFile.trace) DebugFile.writeln("NullPointerException at atom "+String.valueOf(oAtm.getInt(DB.pg_atom))+" "+npe.getMessage()+" "+StackTraceUtil.getStackTrace(npe));
                     try { oCon.rollback(); oAtm.setStatus(oCon, Atom.STATUS_INTERRUPTED, "NullPointerException "+npe.getMessage()); oCon.commit(); } catch (SQLException ignore) { }
                     oRst.close(); oRst=null;
                    oStm.close(); oStm=null;
                     break;
                   } catch (MessagingException msge) {
                     nErrs++;
                     System.out.println("Mail number "+String.valueOf(oAtm.getInt(DB.pg_atom))+" "+oAtm.getString(DB.tx_email)+" failed with MessagingException "+msge.getMessage());
                     if (DebugFile.trace) DebugFile.writeln(msge.getClass().getName()+" at atom "+String.valueOf(oAtm.getInt(DB.pg_atom))+" "+msge.getMessage()+" "+StackTraceUtil.getStackTrace(msge));
                     try { oCon.rollback(); oAtm.setStatus(oCon, Atom.STATUS_INTERRUPTED, "MessagingException "+msge.getMessage()); oCon.commit(); } catch (SQLException ignore) { }
                   } finally {
                     bHasNext = oRst.next();
                   }
                 } //wend
                 if (null!=oRst) oRst.close();
View Full Code Here

Examples of cs227b.teamIago.resolver.Atom

public static Expression parseExpression(Object _s){
  if (_s instanceof ArrayList)
    _s = ((ArrayList)_s).get(0);
  if (_s instanceof String){
    if (((String)_s).startsWith("?"))
      return new Variable(new Atom((String)_s));
    return new Atom((String)_s);
  }
  Statement s = (Statement) _s;
  String opt = s.operator.toUpperCase();
  Expression res=null;
 
View Full Code Here

Examples of erjang.beam.repr.Operands.Atom

        return new Insn.IWI(opcode, i1, al, i3);
      }

      case func_info:
      {
        Atom mod = readAtom();
        Atom fun = readAtom();
        int arity = readCodeInteger();
        return new Insn.AAI(opcode, mod,fun,arity);
      }

      case call_ext_last:
View Full Code Here

Examples of gnu.x11.Atom

  display.check_error();
    }

    private void clientMessage(ClientMessage event) {
  if (event.window_id() == 0) {
      Atom type = event.type();
      if (type.name.equals("SERVER_SHUTDOWN")) {
    System.err.println("Xremwin server shutdown detected");
    exit_now = true;
    return;
      }
  }
     
  X11Client client
      = (X11Client)X11Client.intern(this, event.window_id());
  Atom type = event.type();
  // client asks to change window state from normal to iconic
  if (event.format() == 32 /*atom*/) {
      if (type.name.equals("WM_CHANGE_STATE")
    && event.wm_data () == Window.WMHints.ICONIC)
      {
View Full Code Here

Examples of jason.asSyntax.Atom

        Iterator variables = p.iterator();
       
        List<Term> terms = new ArrayList<Term>();
        while(variables.hasNext()){
          Constant var = (Constant) variables.next();
          Atom term = new Atom(var.getImage());
          terms.add(term);
         
          Set<String> setVar = this.types.get(var.getTypeSet().toString());
          setVar.add(var.getImage());
        }
View Full Code Here

Examples of name.mjw.jamber.IO.AMBER.Atom

       * Set the HEM residue external connection bond by hand since Mol2
       * does not contain that information.
       */

      Residue hemeResidue = lib.getResidueByName("HEM");
      Atom connectionAtom = hemeResidue.getAtoms().get(27);
      hemeResidue.appendExternalBond(connectionAtom);

      // Load CYP residue information
      lib.addFromMol2(cyp);

      Residue cypResidue = lib.getResidueByName("CYP");
      Atom connectionAtomN = cypResidue.getAtoms().get(0);
      Atom connectionAtomC = cypResidue.getAtoms().get(8);
      Atom connectionAtomS = cypResidue.getAtoms().get(7);
      cypResidue.appendExternalBond(connectionAtomN);
      cypResidue.appendExternalBond(connectionAtomC);
      cypResidue.appendExternalBond(connectionAtomS);

    } catch (IOException e) {
View Full Code Here

Examples of org.biojava.bio.structure.Atom

  /**
   * initalizes the display
   */
  private void initJmolDisplay() {
    Atom a = new AtomImpl();
    a.setName("CA");
    a.setFullName(" CA ");
    a.setCoords(new double[] { 47.866, 28.415, 2.952 });

    Group g = new AminoAcidImpl();
    g.setPDBCode("9");
    try {
      g.setPDBName("GLY");
View Full Code Here

Examples of org.ictclas4j.bean.Atom

      result = new ArrayList<Atom>();
      String[] ss = GFString.atomSplit(str);

      int index = str.indexOf(Utility.SENTENCE_BEGIN);
      if (index == 0) {
        Atom atom = new Atom();
        atom.setWord(Utility.SENTENCE_BEGIN);
        atom.setLen(Utility.SENTENCE_BEGIN.length());
        atom.setPos(Utility.CT_SENTENCE_BEGIN);
        result.add(atom);
        index += Utility.SENTENCE_BEGIN.length();
      }

      if (index == -1)
        index = 0;
      for (int i = index; i < ss.length; i++) {
        if (Utility.SENTENCE_END.equals(str.substring(i))) {
          Atom atom = new Atom();
          atom.setWord(Utility.SENTENCE_END);
          atom.setLen(Utility.SENTENCE_END.length());
          atom.setPos(Utility.CT_SENTENCE_END);
          result.add(atom);
          break;
        }

        String s = ss[i];
        sAtom += s;
        int curType = Utility.charType(s);
        if (".".equals(s)
            && (i + 1 < ss.length && (Utility.charType(ss[i + 1]) == Utility.CT_NUM || GFString
                .isNumeric(ss[i+1]))))
          curType = Utility.CT_NUM;

        // ����Ǻ��֡��ָ�����
        if (curType == Utility.CT_CHINESE || curType == Utility.CT_INDEX || curType == Utility.CT_DELIMITER
            || curType == Utility.CT_OTHER) {

          Atom atom = new Atom();
          atom.setWord(s);
          atom.setLen(s.length());
          atom.setPos(curType);
          result.add(atom);
          sAtom = "";
        }
        // ��������֡���ĸ�����ֽڷ��ţ�������ڵ���Щ��Ϊһ��ԭ�ӡ����磺����SHX-123�ͺŵ��ֻ��������е�SHX-123����һ��ԭ��
        else {
          int nextType = 255;// ��һ���ַ�������
          if (i < ss.length - 1)
            nextType = Utility.charType(ss[i + 1]);
          if (nextType != curType || i == ss.length - 1) {
            Atom atom = new Atom();
            atom.setWord(sAtom);
            atom.setLen(sAtom.length());
            atom.setPos(curType);
            result.add(atom);
            sAtom = "";
          }
        }
      }
View Full Code Here

Examples of org.ictclas4j.bean.Atom

   * @return
   */
  public static SegGraph generate(ArrayList<Atom> atoms, DictLib dictLib) {
    SegGraph segGraph = null;
    SegNode sn = null;
    Atom atom = null;

    if (atoms != null && atoms.size() > 0 && dictLib != null) {
      segGraph = new SegGraph();
      Dictionary dict = dictLib.getCoreDict();

      // �ȰѷǺ����ַ��Ĵ���ʶ�����
      for (int i = 0; i < atoms.size(); i++) {
        atom = atoms.get(i);
        String word = atom.getWord();
        if (atom.getPos() == Utility.CT_CHINESE)
          sn = new SegNode(i, i + 1, 0, 0, atom.getWord());
        else {
          int pos = 0;
          double value = Utility.MAX_FREQUENCE;

          switch (atom.getPos()) {
          case Utility.CT_INDEX:
          case Utility.CT_NUM:
            pos = -POSTag.NUM;// 'm'*256
            word = Utility.UNKNOWN_NUM;
            value = 0;
            break;
          case Utility.CT_DELIMITER:
            pos = POSTag.PUNC;// 'w'*256;
            break;
          case Utility.CT_LETTER:
            pos = -POSTag.NOUN_LETTER;//
            value = 0;
            word = Utility.UNKNOWN_LETTER;
            break;
          case Utility.CT_SINGLE:// 12021-2129-3121
            if (Utility.getCharCount("+-1234567890", atom.getWord()) == atom.getLen()) {
              pos = -POSTag.NUM;// 'm'*256
              word = Utility.UNKNOWN_NUM;
            } else {
              pos = -POSTag.NOUN_LETTER;//
              word = Utility.UNKNOWN_LETTER;
            }
            value = 0;
            break;
          default:
            pos = atom.getPos();// '?'*256;
            break;
          }

          int gbkID = dictLib.getGBKID(word);
          sn = new SegNode(i, i + 1, pos, value, word);
          sn.setGbkID(gbkID);
        }

        sn.setSrcWord(atom.getWord());
        segGraph.insert(sn, true);
      }

      StringBuffer words = new StringBuffer();
      for (int i = 0; i < atoms.size(); i++) {
        int j = i + 1;
        words.delete(0, words.length());
        words.append(atoms.get(i).getWord());

        // ����ǡ��·ݡ�����Ҫ�ָ�
        boolean flag = false;
        if (j < atoms.size()) {
          Atom a2 = atoms.get(j);
          if ("��".equals(words.toString()) && "��".equals(a2.getWord())) {
            segGraph.delete(i, j);
            segGraph.delete(i + 1, j + 1);
            words.append(a2.getWord());
            flag = true;
            j++;
          }
        }

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.