Examples of ClassItem


Examples of org.encog.util.arrayutil.ClassItem

          if (this.analystHeaders.find(field.getName()) != -1) {

            if (field.isOutput()) {
              if (field.isClassify()) {
                // classification
                final ClassItem cls = field.determineClass(
                    outputIndex, output.getData());
                outputIndex += field.getColumnsNeeded();
                if (cls == null) {
                  row.getData()[index++] = "?Unknown?";
                } else {
                  row.getData()[index++] = cls.getName();
                }
              } else {
                // regression
                double n = output.getData(outputIndex++);
                n = field.deNormalize(n);
View Full Code Here

Examples of org.encog.util.arrayutil.ClassItem

          if (this.analystHeaders.find(field.getName()) != -1) {

            if (field.isOutput() || field.getName().equals(otherOutput)) {
              if (field.isClassify()) {
                // classification
                final ClassItem cls = field.determineClass(
                    outputIndex, output.getData());
                outputIndex += field.getColumnsNeeded();
                if (cls == null) {
                  row.getData()[index++] = "?Unknown?";
                } else {
                  row.getData()[index++] = cls.getName();
                }
              } else {
                // regression
                double n = output.getData(outputIndex++);
                n = field.deNormalize(n);
View Full Code Here

Examples of org.encog.util.arrayutil.ClassItem

          || (norm.getAction() == NormalizationAction.SingleField)) {

        int index = 0;
        for (final AnalystClassItem item : f.getClassMembers()) {
          norm.getClasses().add(
              new ClassItem(item.getName(), index++));
        }
      }
    }
  }
View Full Code Here

Examples of org.encog.util.arrayutil.ClassItem

    this.actualHigh = 0;
    this.actualLow = 0;

    int index = 0;
    for (int i = classFrom; i < classTo; i++) {
      this.classes.add(new ClassItem("" + i, index++));
    }

  }
View Full Code Here

Examples of org.encog.util.arrayutil.ClassItem

    this.normalizedLow = low;
    this.actualHigh = 0;
    this.actualLow = 0;

    for (int i = 0; i < cls.length; i++) {
      this.classes.add(new ClassItem(cls[i], i));
    }

  }
View Full Code Here

Examples of org.jibx.binding.classes.ClassItem

                    attribute = false;
                } else if (tname.startsWith("java.")) {
                   
                    // check for standard library classes we can handle
                    ClassFile pcf = ClassCache.requireClassFile(tname);
                    ClassItem init = pcf.getInitializerMethod
                        ("(Ljava/lang/String;)");
                    if (init != null) {
                        simple = pcf.getMethod("toString",
                            "()Ljava/lang/String;") != null;
                        attribute = false;
                    }
                   
                }
               
                // check type of handling to use for value
                if (m_enumerationNames.get(tname) != null) {
                   
                    // define a value using deserializer method
                    String mname = (String)m_enumerationNames.get(tname);
                    int split = mname.lastIndexOf('.');
                    ClassFile dcf =
                        ClassCache.requireClassFile(mname.substring(0, split));
                    ClassItem dser =
                        dcf.getStaticMethod(mname.substring(split+1),
                        "(Ljava/lang/String;)");
                    if (dser == null || !tname.equals(dser.getTypeName())) {
                        throw new JiBXException("Deserializer method not " +
                            "found for enumeration class " + tname);
                    }
                    ValueElement value = new ValueElement();
                    value.setFieldName(fname);
View Full Code Here

Examples of org.jibx.binding.classes.ClassItem

        for (int i = 0; i < props.size(); i++) {
            String pname = (String)props.get(i);
            String base = Character.toUpperCase(pname.charAt(0)) +
                pname.substring(1);
            String gname = "get" + base;
            ClassItem gmeth = cf.getMethod(gname, "()");
            if (gmeth == null) {
                throw new JiBXException("No method " + gname +
                    "() found for property " + base + " in class " +
                    cf.getName());
            } else {
                String tname = gmeth.getTypeName();
                String sname = "set" + base;
                String sig = "(" + gmeth.getSignature().substring(2) + ")V";
                ClassItem smeth = cf.getMethod(sname, sig);
                if (smeth == null) {
                    throw new JiBXException("No method " + sname + "(" + tname +
                        ") found for property " + base + " in class " +
                        cf.getName());
                } else {
                   
                    // find type of handling needed for field type
                    boolean simple = false;
                    boolean object = true;
                    boolean attribute = true;
                    if (ClassItem.isPrimitive(tname)) {
                        simple = true;
                        object = false;
                    } else if (s_objectPrimitiveSet.contains(tname)) {
                        simple = true;
                    } else if (tname.equals("byte[]")) {
                        simple = true;
                        attribute = false;
                    } else if (tname.startsWith("java.")) {
                       
                        // check for standard library classes we can handle
                        ClassFile pcf = ClassCache.requireClassFile(tname);
                        if (pcf.getInitializerMethod("()") != null) {
                            simple = pcf.getMethod("toString",
                                "()Ljava/lang/String;") != null;
                            attribute = false;
                        }
                       
                    }
                    if (simple) {
                       
                        // define a simple value
                        ValueElement value = new ValueElement();
                        value.setGetName(gname);
                        value.setSetName(sname);
                        value.setName(valueName(pname));
                        if (object) {
                            value.setUsageName("optional");
                        }
                        if (!attribute) {
                            value.setStyleName("element");
                        }
                        contain.addChild(value);
                       
                    } else if (m_enumerationNames.get(tname) != null) {
                       
                        // define a value using deserializer method
                        String mname = (String)m_enumerationNames.get(tname);
                        int split = mname.lastIndexOf('.');
                        ClassFile dcf = ClassCache.
                            requireClassFile(mname.substring(0, split));
                        ClassItem dser =
                            dcf.getStaticMethod(mname.substring(split+1),
                            "(Ljava/lang/String;)");
                        if (dser == null || !tname.equals(dser.getTypeName())) {
                            throw new JiBXException("Deserializer method not " +
                                "found for enumeration class " + tname);
                        }
                        ValueElement value = new ValueElement();
                        value.setGetName(gname);
View Full Code Here

Examples of org.jibx.binding.classes.ClassItem

        HashSet dataset, HashSet exceptset) throws JiBXException {
        ClassFile cf = ClassCache.getClassFile(cname);
        if (cf != null) {
            for (int i = 0; i < mnames.size(); i++) {
                String mname = (String)mnames.get(i);
                ClassItem mitem = cf.getMethod(mname, "");
                if (mitem == null) {
                    System.err.println("Method " + mname +
                        " not found in class " + cname);
                } else {
                    if (dataset != null) {
                        String type = mitem.getTypeName();
                        if (type != null && isMappable(type)) {
                            dataset.add(type);
                        }
                        String[] args = mitem.getArgumentTypes();
                        for (int j = 0; j < args.length; j++) {
                            type = args[j];
                            if (isMappable(type)) {
                                dataset.add(args[j]);
                            }
                        }
                    }
                    if (exceptset != null) {
                        String[] excepts = mitem.getExceptions();
                        for (int j = 0; j < excepts.length; j++) {
                            exceptset.add(excepts[j]);
                        }
                    }
                }
View Full Code Here

Examples of org.jibx.binding.classes.ClassItem

    /* (non-Javadoc)
     * @see org.jibx.binding.model.IClass#getDirectField(java.lang.String)
     */
    public IClassItem getDirectField(String name) {
        ClassItem item = m_class.getDirectField(name);
        if (item == null) {
            return null;
        } else {
            return buildItem(item);
        }
View Full Code Here

Examples of org.jibx.binding.classes.ClassItem

    /* (non-Javadoc)
     * @see org.jibx.binding.model.IClass#getMethod(java.lang.String, java.lang.String)
     */
    public IClassItem getMethod(String name, String sig) {
        ClassItem item = m_class.getMethod(name, sig);
        if (item == null) {
            return null;
        } else {
            return buildItem(item);
        }
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.