Example usage for java.lang Byte Byte

List of usage examples for java.lang Byte Byte

Introduction

In this page you can find the example usage for java.lang Byte Byte.

Prototype

@Deprecated(since = "9")
public Byte(String s) throws NumberFormatException 

Source Link

Document

Constructs a newly allocated Byte object that represents the byte value indicated by the String parameter.

Usage

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityDb2LUW.CFSecurityDb2LUWSchema.java

public static Byte getNullableByte(ResultSet reader, int colidx) {
    try {//from  w  w  w  . j av  a  2  s .  co m
        byte val = reader.getByte(colidx);
        if (reader.wasNull()) {
            return (null);
        } else {
            return (new Byte(val));
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(CFSecurityDb2LUWSchema.class, "getNullableByte",
                e);
    }
}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityOracle.CFSecurityOracleSchema.java

public static Byte getNullableByte(ResultSet reader, int colidx) {
    try {/*from w ww  . j  a va  2  s .  com*/
        byte val = reader.getByte(colidx);
        if (reader.wasNull()) {
            return (null);
        } else {
            return (new Byte(val));
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(CFSecurityOracleSchema.class, "getNullableByte",
                e);
    }
}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_1.CFSecuritySybase.CFSecuritySybaseSchema.java

public static Byte getNullableByte(ResultSet reader, int colidx) {
    try {//from   w w  w. j  av  a2 s  . c  om
        byte val = reader.getByte(colidx);
        if (reader.wasNull()) {
            return (null);
        } else {
            return (new Byte(val));
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(CFSecuritySybaseSchema.class, "getNullableByte",
                e);
    }
}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityMySql.CFSecurityMySqlSchema.java

public static Byte getNullableByte(ResultSet reader, int colidx) {
    try {//from w  w  w.j  av  a  2  s  .  co m
        byte val = reader.getByte(colidx);
        if (reader.wasNull()) {
            return (null);
        } else {
            return (new Byte(val));
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(CFSecurityMySqlSchema.class, "getNullableByte",
                e);
    }
}

From source file:ar.com.fdvs.dj.core.layout.Dj2JrCrosstabBuilder.java

private void createColumTotalHeader(JRDesignCrosstabColumnGroup ctColGroup, DJCrosstabColumn crosstabColumn) {
    JRDesignCellContents totalHeaderContent = new JRDesignCellContents();
    ctColGroup.setTotalHeader(totalHeaderContent);
    ctColGroup.setTotalPosition(BucketDefinition.TOTAL_POSITION_END);

    Style totalHeaderstyle = crosstabColumn.getTotalHeaderStyle() == null
            ? this.djcross.getColumnTotalheaderStyle()
            : crosstabColumn.getTotalHeaderStyle();

    totalHeaderContent.setMode(new Byte(Transparency.OPAQUE.getValue()));

    JRDesignExpression exp = null;/* w w  w . j  ava2  s .c om*/
    if (crosstabColumn.getTotalLegend() != null) {
        exp = ExpressionUtils.createExpression("\"" + crosstabColumn.getTotalLegend() + "\"", String.class);
    } else {
        exp = ExpressionUtils.createExpression("\"Total " + crosstabColumn.getTitle() + "\"", String.class);
    }
    JRDesignTextField element = new JRDesignTextField();
    element.setExpression(exp);
    element.setWidth(crosstabColumn.getWidth());

    if (totalHeaderstyle != null) {
        layoutManager.applyStyleToElement(totalHeaderstyle, element);
        totalHeaderContent.setBackcolor(totalHeaderstyle.getBackgroundColor());
    }

    //The height can be the sum of the heights of all the columns starting from the current one, up to the inner most one.
    int auxWidth = 0;
    boolean found = false;
    for (Iterator iterator = djcross.getColumns().iterator(); iterator.hasNext();) {
        DJCrosstabColumn col = (DJCrosstabColumn) iterator.next();
        if (!col.equals(crosstabColumn) && found == false) {
            continue;
        } else {
            found = true;
        }

        auxWidth += col.getHeaderHeight();
    }
    element.setHeight(auxWidth);

    applyCellBorder(totalHeaderContent);

    totalHeaderContent.addElement(element);

}

From source file:net.sf.json.TestJSONObject.java

public void testToBean_emptyBean() {
    EmptyBean bean = new EmptyBean();

    JSONObject json = JSONObject.fromObject(bean);
    JSONObject expected = new JSONObject();
    expected.element("arrayp", new JSONArray());
    expected.element("listp", new JSONArray());
    expected.element("bytep", new Integer(0));
    expected.element("shortp", new Integer(0));
    expected.element("intp", new Integer(0));
    expected.element("longp", new Integer(0));
    expected.element("floatp", new Integer(0));
    expected.element("doublep", new Double(0));
    expected.element("charp", "");
    expected.element("stringp", "");

    Assertions.assertEquals(expected, json);

    EmptyBean bean2 = (EmptyBean) JSONObject.toBean(json, EmptyBean.class);

    ArrayAssertions.assertEquals(new Object[0], bean2.getArrayp());
    Assertions.assertEquals(new ArrayList(), bean2.getListp());
    Assertions.assertEquals(new Byte((byte) 0), bean2.getBytep());
    Assertions.assertEquals(new Short((short) 0), bean2.getShortp());
    Assertions.assertEquals(new Integer(0), bean2.getIntp());
    Assertions.assertEquals(new Long(0), bean2.getLongp());
    Assertions.assertEquals(new Float(0), bean2.getFloatp());
    Assertions.assertEquals(new Double(0), bean2.getDoublep());
    Assertions.assertEquals(new Character('\0'), bean2.getCharp());
    Assertions.assertEquals("", bean2.getStringp());
}

From source file:com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.java

protected Output getOutput(Byte format, String baseFilename) throws JobExecutionException {
    if (format == null) {
        throw new JSException("jsexception.report.unknown.output.format", new Object[] { "null" });
    }/*from   w  ww .  j  a v a 2s  . c om*/

    if (format == ReportJob.OUTPUT_FORMAT_DATA_SNAPSHOT) {
        hasDataSnapshotOutput = true;
        dataSnapshotOutputName = baseFilename;
        return null;
    }

    String fileExtension = (String) getOutputKeyMapping().get(format.toString());
    if (fileExtension == null) {
        throw new JSException("jsexception.report.unknown.output.format", new Object[] { new Byte(format) });
    }

    return (Output) getOutputFormatMap().get(fileExtension);
}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8Schema.java

public static Byte getNullableByte(ResultSet reader, int colidx) {
    try {//  ww w .  java2  s  .  com
        byte val = reader.getByte(colidx);
        if (reader.wasNull()) {
            return (null);
        } else {
            return (new Byte(val));
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(MSSBamPg8Schema.class, "getNullableByte", e);
    }
}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityMSSql.CFSecurityMSSqlSchema.java

public static Byte getNullableByte(ResultSet reader, int colidx) {
    try {//from   ww w . j  av  a 2s.  c o m
        byte val = reader.getByte(colidx);
        if (reader.wasNull()) {
            return (null);
        } else {
            return (new Byte(val));
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(CFSecurityMSSqlSchema.class, "getNullableByte",
                e);
    }
}

From source file:net.sf.jasperreports.engine.xml.JRXmlConstants.java

/**
 * @deprecated Replaced by {@link HorizontalAlignEnum}.
 */// ww  w . j  av a2  s  .  c  om
public static Map getHorizontalAlignMap() {
    if (horizontalAlignMap == null) {
        Map map = new HashMap(11);
        map.put(HORIZONTAL_ALIGN_LEFT, new Byte(JRAlignment.HORIZONTAL_ALIGN_LEFT));
        map.put(HORIZONTAL_ALIGN_CENTER, new Byte(JRAlignment.HORIZONTAL_ALIGN_CENTER));
        map.put(HORIZONTAL_ALIGN_RIGHT, new Byte(JRAlignment.HORIZONTAL_ALIGN_RIGHT));
        map.put(HORIZONTAL_ALIGN_JUSTIFIED, new Byte(JRAlignment.HORIZONTAL_ALIGN_JUSTIFIED));
        map.put(new Byte(JRAlignment.HORIZONTAL_ALIGN_LEFT), HORIZONTAL_ALIGN_LEFT);
        map.put(new Byte(JRAlignment.HORIZONTAL_ALIGN_CENTER), HORIZONTAL_ALIGN_CENTER);
        map.put(new Byte(JRAlignment.HORIZONTAL_ALIGN_RIGHT), HORIZONTAL_ALIGN_RIGHT);
        map.put(new Byte(JRAlignment.HORIZONTAL_ALIGN_JUSTIFIED), HORIZONTAL_ALIGN_JUSTIFIED);
        horizontalAlignMap = Collections.unmodifiableMap(map);
    }

    return horizontalAlignMap;
}