Examples of toIntValue()


Examples of com.cburch.logisim.data.Value.toIntValue()

        if (layout.subLayouts.length == parent.getEnds().size() - 2) {
            int index = layout.subLayouts.length / 2 + 1;
            Object factory = parent.getFactory();
            if (factory instanceof AbstractGate) {
                Value val = ((AbstractGate) factory).getIdentity();
                Integer valInt = Integer.valueOf(val.toIntValue());
                Location loc = parent.getEnd(index).getLocation();
                AttributeSet attrs = Constant.FACTORY.createAttributeSet();
                attrs.setValue(Constant.ATTR_VALUE, valInt);
                result.add(Constant.FACTORY.createComponent(loc, attrs));
            }
View Full Code Here

Examples of com.cburch.logisim.data.Value.toIntValue()

        }

        // each nibble is one segment, in top-down, left-to-right
        int segs;
          // order: middle three nibbles are the three horizontal segments
        switch (baseVal.toIntValue()) {
        case 0:  segs = 0x1110111; break;
        case 1:  segs = 0x0000011; break;
        case 2:  segs = 0x0111110; break;
        case 3:  segs = 0x0011111; break;
        case 4:  segs = 0x1001011; break;
View Full Code Here

Examples of org.encog.ml.prg.expvalue.ExpressionValue.toIntValue()

                .getFunctions()
                .factorProgramNode("+", parent.getOwner(),
                    new ProgramNode[] { child1, child2 });
          }
        } else if (v.isInt()) {
          final long v2 = v.toIntValue();
          if (v2 < 0) {
            child2.getData()[0] = new ExpressionValue(-v2);
            parent = parent
                .getOwner()
                .getContext()
View Full Code Here

Examples of org.encog.ml.prg.expvalue.ExpressionValue.toIntValue()

                .getFunctions()
                .factorProgramNode("-", parent.getOwner(),
                    new ProgramNode[] { child1, child2 });
          }
        } else if (v.isInt()) {
          final long v2 = v.toIntValue();
          if (v2 < 0) {
            child2.getData()[0] = new ExpressionValue(-v2);
            parent = parent
                .getOwner()
                .getContext()
View Full Code Here

Examples of org.encog.ml.prg.expvalue.ExpressionValue.toIntValue()

        success = true;
      }
      break;
    case intType:
      if (v.isNumeric()) {
        result.setData(0, v.toIntValue());
        success = true;
      }
      break;
    case enumType:
      if (v.isEnum()) {
View Full Code Here

Examples of org.encog.ml.prg.expvalue.ExpressionValue.toIntValue()

        success = true;
      }
      break;
    case enumType:
      if (v.isEnum()) {
        result.setData(0, v.toIntValue());
        success = true;
      }
      break;
    }
View Full Code Here

Examples of org.encog.ml.prg.expvalue.ExpressionValue.toIntValue()

  }
 
  public void testTypes() {
    ExpressionValue exp = EncogProgram.parseExpression("cint(1.2345678)");
    Assert.assertTrue(exp.isInt());
    Assert.assertEquals( 1, exp.toIntValue());
 
    exp = EncogProgram.parseExpression("cstr(1.2345678)");
    Assert.assertTrue(exp.isString());
    Assert.assertEquals( "1.2345678", exp.toStringValue());
   
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.