Examples of Vector


Examples of java.util.Vector

   *
   * @return an enumeration of all the available options.
   */
  public Enumeration listOptions() {

    Vector newVector = new Vector(1);
    Enumeration enu = super.listOptions();
    while (enu.hasMoreElements()) {
      newVector.addElement(enu.nextElement());
    }

    newVector.addElement(new Option(
              "\tName of a directory to search for cost files when loading\n"
              +"\tcosts on demand (default current directory).",
              "D", 1, "-D <directory>"));

    return newVector.elements();
  }
View Full Code Here

Examples of java.util.Vector

         String replyCode = line.substring(0, 3);
         StringBuffer reply = new StringBuffer("");
         if (line.length() > 3)
             reply.append(line.substring(4));
                 
         Vector dataLines = null;

         // check for multi-line response and build up
         // the reply
         if (line.length() > 3 && line.charAt(3) == '-') {
             dataLines = new Vector();
            
             // if first line has data, add to data list
             if (line.length() > 4) {
                 line = line.substring(4).trim();
                 if (line.length() > 0)
                     dataLines.addElement(line);
             }
            
             boolean complete = false;
             while (!complete) {
                
                 line = readLine();
                 if (line == null){
                     String msg = "Control channel unexpectedly closed";
                     log.error(msg);
                     throw new ControlChannelIOException(msg);
                 }
                                 
                 if (line.length() == 0)
                     continue;
                
                 log(line, false);
                
                 if (line.length() > 3 &&
                         line.substring(0, 3).equals(replyCode) &&
                         line.charAt(3) == ' ') {
                     line = line.substring(3).trim(); // get rid of the code
                     if (line.length() > 0) {
                         if (reply.length() > 0)
                             reply.append(" ");
                         reply.append(line);
                         dataLines.addElement(line);
                     }
                     complete = true;
                 }
                 else { // not the last line
                     reply.append(" ").append(line);
                     dataLines.addElement(line);
                 }
             } // end while
         } // end if
        
         if (dataLines != null) {
             String[] data = new String[dataLines.size()];
             dataLines.copyInto(data);
             return new FTPReply(replyCode, reply.toString(), data);
         }
         else {
             return new FTPReply(replyCode, reply.toString());
         }
View Full Code Here

Examples of java.util.Vector

   
    // don't do anything if the thread that we've been running in has been interrupted
    if (Thread.currentThread().isInterrupted()) {
      return;
    }
    Vector l;
    synchronized (this) {
      l = (Vector)m_batchClassifierListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  ((BatchClassifierListener)l.elementAt(i)).acceptClassifier(ce);
      }
    }
  }
View Full Code Here

Examples of java.util.Vector

   * Notify all graph listeners of a graph event
   *
   * @param ge a <code>GraphEvent</code> value
   */
  private void notifyGraphListeners(GraphEvent ge) {
    Vector l;
    synchronized (this) {
      l = (Vector)m_graphListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  ((GraphListener)l.elementAt(i)).acceptGraph(ge);
      }
    }
  }
View Full Code Here

Examples of java.util.Vector

   *
   * @return an enumeration of all the available options.
   */
  public Enumeration listOptions() {

    Vector newVector = new Vector(4);

    newVector.addElement(new Option(
       "\tThe full class name of the classifier.\n"
        +"\teg: weka.classifiers.bayes.NaiveBayes",
       "W", 1,
       "-W <class name>"));
    newVector.addElement(new Option(
       "\tThe index of the class for which IR statistics\n" +
       "\tare to be output. (default 1)",
       "C", 1,
       "-C <index>"));
    newVector.addElement(new Option(
       "\tThe index of an attribute to output in the\n" +
       "\tresults. This attribute should identify an\n" +
             "\tinstance in order to know which instances are\n" +
             "\tin the test set of a cross validation. if 0\n" +
             "\tno output (default 0).",
       "I", 1,
       "-I <index>"));
    newVector.addElement(new Option(
       "\tAdd target and prediction columns to the result\n" +
             "\tfor each fold.",
       "P", 0,
       "-P"));

    if ((m_Template != null) &&
  (m_Template instanceof OptionHandler)) {
      newVector.addElement(new Option(
       "",
       "", 0, "\nOptions specific to classifier "
       + m_Template.getClass().getName() + ":"));
      Enumeration enu = ((OptionHandler)m_Template).listOptions();
      while (enu.hasMoreElements()) {
  newVector.addElement(enu.nextElement());
      }
    }
    return newVector.elements();
  }
View Full Code Here

Examples of java.util.Vector

   * Notify all text listeners of a text event
   *
   * @param ge a <code>TextEvent</code> value
   */
  private void notifyTextListeners(TextEvent ge) {
    Vector l;
    synchronized (this) {
      l = (Vector)m_textListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  ((TextListener)l.elementAt(i)).acceptText(ge);
      }
    }
  }
View Full Code Here

Examples of java.util.Vector

    // don't do anything if the thread that we've been running in has been interrupted
    if (Thread.currentThread().isInterrupted()) {
      return;
    }
   
    Vector l;
    synchronized (this) {
      l = (Vector)m_incrementalClassifierListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  ((IncrementalClassifierListener)l.elementAt(i)).acceptClassifier(ce);
      }
    }
  }
View Full Code Here

Examples of java.util.Vector

   * Returns an enumeration of any additional measure names that might be
   * in the classifier
   * @return an enumeration of the measure names
   */
  public Enumeration enumerateMeasures() {
    Vector newVector = new Vector();
    if (m_Template instanceof AdditionalMeasureProducer) {
      Enumeration en = ((AdditionalMeasureProducer)m_Template).
  enumerateMeasures();
      while (en.hasMoreElements()) {
  String mname = (String)en.nextElement();
  newVector.addElement(mname);
      }
    }
    return newVector.elements();
  }
View Full Code Here

Examples of jpbrt.core.Vector

        // compute sphere dpdu and dpdv
        double zradius = Math.sqrt(phit.x * phit.x + phit.y * phit.y);
        double invzradius = 1.0 / zradius;
        double cosphi = phit.x / invzradius;
        double sinphi = phit.y / invzradius;
        Vector dpdu = new Vector(-phiMax * phit.y, phiMax * phit.x, 0.0);
        Vector dpdv = new Vector(phit.z * cosphi, phit.z * sinphi, -radius * Math.sin(theta)).mulLocal(thetaMax - thetaMin);
       
        // compute sphere dndu and dndv
        Vector d2Pduu = new Vector(phit.x, phit.y, 0).mulLocal(-phiMax * phiMax);
        Vector d2Pduv = new Vector(-sinphi, cosphi, 0).mulLocal( (thetaMax - thetaMin) * phit.z * phiMax );
        Vector d2Pdvv = new Vector(phit.x, phit.y, phit.z).mulLocal( -(thetaMax - thetaMin) * (thetaMax - thetaMin) );
       
        // compute coefficients for fundamental forms
        double E = dpdu.dot(dpdu);
        double F = dpdu.dot(dpdv);
        double G = dpdv.dot(dpdv);
        Vector N = dpdu.cross(dpdv).normalizeLocal();
        double e = N.dot(d2Pduu);
        double f = N.dot(d2Pduv);
        double g = N.dot(d2Pdvv);
       
        // compute dndu and dndv from fundamental form coefficients
        double invEGF2 = 1.0 / (E*G - F*F);
        Normal dndu = new Normal(dpdu.mul( (f*F - e*G) * invEGF2 ).addLocal( dpdv.mul((e*F - f*E) * invEGF2) ));
        Normal dndv = new Normal(dpdu.mul( (g*F - f*G) * invEGF2 ).addLocal( dpdv.mul((f*F - g*E) * invEGF2) ));
View Full Code Here

Examples of koth.util.Vector

        Algorithms.sort(Algorithms.ReversedComparator.<Integer>getInstance(), dists, allies);
        // Most endangered pawn must flee!
        for (int i = 0; i < allies.size(); ++i) {
            Pawn a = allies.get(i);
            for (Move m : Move.getNonzeros()) {
                Vector t = a.getLocation().add(m);
                if (game.isFree(t) && distanceToFoes(t, foes) > dists.get(i))
                    return new Action(a, m);
            }
        }
        // We can't flee anymore :'(
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.