Examples of AttrInfo


Examples of org.perl6.nqp.sixmodel.reprs.CStructREPRData.AttrInfo

            if (parents <= 1) {
                long numAttrs = attrs.elems(tc);
                for (long j = 0; j < numAttrs; j++) {
                    SixModelObject attrHash = attrs.at_pos_boxed(tc, j);
                    AttrInfo info = new AttrInfo();
                    info.name = attrHash.at_key_boxed(tc, "name").get_str(tc);
                    info.type = attrHash.at_key_boxed(tc, "type");
                    StorageSpec spec = info.type.st.REPR.get_storage_spec(tc, info.type.st);
                    info.bits = spec.bits;
                    repr_data.fieldTypes.put(info.name, info);
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.CStructREPRData.AttrInfo

     * such is probably better, but that's harder to implement. */
    public HashMap<String, SixModelObject> memberCache = new HashMap<String, SixModelObject>();

    public void bind_attribute_boxed(ThreadContext tc, SixModelObject class_handle, String name, long hint, SixModelObject value) {
        CStructREPRData data = (CStructREPRData) class_handle.st.REPRData;
        AttrInfo info = data.fieldTypes.get(name);
        /* XXX: This'll break if we try to set a callback member. OTOH, it's
         * broken on Parrot too, so it's not a NativeCall regression as
         * such... */
        storage.writeField(name, NativeCallOps.toJNAType(tc, value, info.argType, null));
        memberCache.put(name, value);
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.CStructREPRData.AttrInfo

        memberCache.put(name, value);
    }

    public void bind_attribute_native(ThreadContext tc, SixModelObject class_handle, String name, long hint) {
        CStructREPRData data = (CStructREPRData) class_handle.st.REPRData;
        AttrInfo info = data.fieldTypes.get(name);
        Object value;
        switch (info.argType) {
        case CHAR:
            tc.native_type = ThreadContext.NATIVE_INT;
            value = new Byte((byte) tc.native_i);
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.CStructREPRData.AttrInfo

    public SixModelObject get_attribute_boxed(ThreadContext tc, SixModelObject class_handle, String name, long hint) {
        SixModelObject member = memberCache.get(name);
        if (member != null) return member;

        CStructREPRData data = (CStructREPRData) class_handle.st.REPRData;
        AttrInfo info = data.fieldTypes.get(name);
        member = NativeCallOps.toNQPType(tc, info.argType, info.type, storage.readField(name));
        memberCache.put(name, member);
        return member;
    }
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.CStructREPRData.AttrInfo

        return member;
    }

    public void get_attribute_native(ThreadContext tc, SixModelObject class_handle, String name, long hint) {
        CStructREPRData data = (CStructREPRData) class_handle.st.REPRData;
        AttrInfo info = data.fieldTypes.get(name);

        Object o = storage.readField(name);
        switch (info.argType) {
        case CHAR:
            tc.native_type = ThreadContext.NATIVE_INT;
View Full Code Here

Examples of shared.AttrInfo

      attribMap.put(attrInfos.get(i).name(), new Pair<>(
          attrInfos.get(i), i));
    }

    // Create Attribute Information on label
    AttrInfo labelAttrib = new NominalAttrInfo(PERFORMANCE_CLASS, perfClasses);

    // Create MLJ meta information
    schema = new Schema(attrInfos, labelAttrib);
    InstanceList instances = createInstances(trainingData, attribMap);
View Full Code Here

Examples of shared.AttrInfo

      if (attrInfos == null) {
        throw new IllegalArgumentException("Attribute '" + confEntry.getKey()
            + "' could not be found in attrbute map!");
      }

      AttrInfo attrInfo = attrInfos.getFirstValue();
      AttrValue val = new AttrValue();

      if (attrInfo instanceof NominalAttrInfo) {
        attrInfo.set_nominal_string(val, confEntry.getValue().toString(), true);
      } else if (attrInfo instanceof RealAttrInfo) {
        attrInfo.set_real_val(val,
            ((Number) confEntry.getValue()).doubleValue());
      }

      instance.values[attrInfos.getSecondValue()] = val;
    }
View Full Code Here

Examples of shared.AttrInfo

   * @param attrInfos
   *          attribute information required for setting the value
   */
  static void setMissingAttribute(Instance instance,
      Pair<AttrInfo, Integer> attrInfos) {
    AttrInfo info = attrInfos.getFirstValue();
    int attribIndex = attrInfos.getSecondValue();
    AttrValue val = new AttrValue();

    if (info instanceof NominalAttrInfo) {
      info.set_nominal_string(val, MISSING_NOM_VAL, true);
    } else if (info instanceof RealAttrInfo) {
      info.set_real_val(val, MISSING_NUM_VAL);
    }

    instance.values[attribIndex] = val;
  }
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.