Package net.sf.cb2java.data

Examples of net.sf.cb2java.data.Data


        Copybook copybook = CopybookParser.parse("B", new FileInputStream(new File("./target/test-classes/b.copybook")));
        assertEquals(31, copybook.getLength());
        List<Record> results = copybook.parseData(new FileInputStream(new File("./target/test-classes/b.input.txt")));
        assertEquals(1, results.size());
        Record record = results.get(0);
        Data root = record.getChild("ROOT");
        assertEquals("ABCDEF", root.getChildren().get(0).toString());
        assertEquals("B", ((Data)root.getChildren().get(1)).getName().toString());
        assertEquals("BCDE", root.getChildren().get(1).toString());
        // TODO assertEquals(12345, root.getChildren().get(2).toString());
        // TODO assertEquals(1234, ((Data)root.getChildren().get(3)).getValue());
        System.out.println(root.toString());
    }
View Full Code Here


        // delete
        // bigI = BigInteger.ZERO;

        // System.out.println(bigI);

        Data data = create();

        if (data instanceof DecimalData) {
            DecimalData dData = (DecimalData) data;

            BigDecimal bigD = new BigDecimal(bigI, decimalPlaces());
View Full Code Here

            s = (isPositive(c) ? "" : "-")
                + (input.length() > 1 ? input.substring(0, last-1) : "") + getNumber(c);
        }
       
        BigInteger big = s == null ? null : new BigInteger(s);
        Data data = create();
       
        if (data instanceof DecimalData) {
            DecimalData dData = (DecimalData) data;
            BigDecimal bigD = big == null ? null : new BigDecimal(big, decimalPlaces());
           
View Full Code Here

    {
//        display(input);
       
        BigInteger bigI = new BigInteger(input);
       
        Data data = create();
       
        if (data instanceof DecimalData) {
            DecimalData dData = (DecimalData) data;
           
            BigDecimal bigD = new BigDecimal(bigI, decimalPlaces());
View Full Code Here

            + (getSignPosition() == LEADING ? "leading" : "trailing") + " but no sign was found on value " + s);
       
        if (sign == '+') s = s.substring(1);

        BigInteger big = new BigInteger(s);
        Data data = create();
       
        if (data instanceof DecimalData) {
            DecimalData dData = (DecimalData) data;
           
            dData.setValue(new BigDecimal(big, decimalPlaces()));
View Full Code Here

TOP

Related Classes of net.sf.cb2java.data.Data

Copyright © 2018 www.massapicom. 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.