List of usage examples for java.lang Short Short
@Deprecated(since = "9") public Short(String s) throws NumberFormatException
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNmTokenDefListPane.java
public CFBamJavaFXNmTokenDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamNmTokenDefObj argFocus, Collection<ICFBamNmTokenDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* w w w . j a va 2s.c om*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamNmTokenDefObj>(); tableColumnObjKind = new TableColumn<ICFBamNmTokenDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamNmTokenDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokenDefObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Long>, TableCell<ICFBamNmTokenDefObj, Long>>() { @Override public TableCell<ICFBamNmTokenDefObj, Long> call(TableColumn<ICFBamNmTokenDefObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokenDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokenDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokenDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokenDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokenDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokenDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokenDefObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokenDefObj, Integer> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { int value = obj.getRequiredMaxLen(); Integer wrapped = new Integer(value); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(wrapped); return (observable); } } }); tableColumnMaxLen.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Integer>, TableCell<ICFBamNmTokenDefObj, Integer>>() { @Override public TableCell<ICFBamNmTokenDefObj, Integer> call( TableColumn<ICFBamNmTokenDefObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokenDefObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokenDefObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokenDefObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokenDefObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokenDefObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokenDefObj, Short> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredShowLines(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnShowLines.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Short>, TableCell<ICFBamNmTokenDefObj, Short>>() { @Override public TableCell<ICFBamNmTokenDefObj, Short> call(TableColumn<ICFBamNmTokenDefObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamNmTokenDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokenDefObj> observable, ICFBamNmTokenDefObj oldValue, ICFBamNmTokenDefObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfNmTokenDef != null) { dataTable.setItems(observableListOfNmTokenDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNmTokensDefListPane.java
public CFBamJavaFXNmTokensDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamNmTokensDefObj argFocus, Collection<ICFBamNmTokensDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from www . j ava 2 s .com*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamNmTokensDefObj>(); tableColumnObjKind = new TableColumn<ICFBamNmTokensDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamNmTokensDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokensDefObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Long>, TableCell<ICFBamNmTokensDefObj, Long>>() { @Override public TableCell<ICFBamNmTokensDefObj, Long> call(TableColumn<ICFBamNmTokensDefObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokensDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokensDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokensDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokensDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokensDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokensDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokensDefObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokensDefObj, Integer> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { int value = obj.getRequiredMaxLen(); Integer wrapped = new Integer(value); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(wrapped); return (observable); } } }); tableColumnMaxLen.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Integer>, TableCell<ICFBamNmTokensDefObj, Integer>>() { @Override public TableCell<ICFBamNmTokensDefObj, Integer> call( TableColumn<ICFBamNmTokensDefObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokensDefObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokensDefObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokensDefObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokensDefObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokensDefObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokensDefObj, Short> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredShowLines(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnShowLines.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Short>, TableCell<ICFBamNmTokensDefObj, Short>>() { @Override public TableCell<ICFBamNmTokensDefObj, Short> call( TableColumn<ICFBamNmTokensDefObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamNmTokensDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokensDefObj> observable, ICFBamNmTokensDefObj oldValue, ICFBamNmTokensDefObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfNmTokensDef != null) { dataTable.setItems(observableListOfNmTokensDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgClient.CFAccXMsgClientSchema.java
public static Short getNullableInt16(ResultSet reader, int colidx) { try {/*from w w w .jav a 2s. co m*/ short val = reader.getShort(colidx); if (reader.wasNull()) { return (null); } else { return (new Short(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAccXMsgClientSchema.class, "getNullableInt64", e); } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskXMsgClient.CFAsteriskXMsgClientSchema.java
public static Short getNullableInt16(ResultSet reader, int colidx) { try {/* w w w . ja v a 2 s.co m*/ short val = reader.getShort(colidx); if (reader.wasNull()) { return (null); } else { return (new Short(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAsteriskXMsgClientSchema.class, "getNullableInt64", e); } }
From source file:com.gatf.generator.core.GatfTestGeneratorMojo.java
private Object getPrimitiveValue(Type claz) { if (isPrimitive(claz)) { if (claz.equals(boolean.class) || claz.equals(Boolean.class)) { Random rand = new Random(); return rand.nextBoolean(); } else if (claz.equals(Date.class)) { return new Date(); } else if (claz.equals(Double.class) || claz.equals(double.class)) { Random rand = new Random(12345678L); return rand.nextDouble(); } else if (claz.equals(Float.class) || claz.equals(float.class)) { Random rand = new Random(12345678L); return rand.nextFloat(); } else if (claz.equals(String.class)) { return RandomStringUtils.randomAlphabetic(10); } else if (claz.equals(Long.class) || claz.equals(long.class) || claz.equals(Number.class)) { Random rand = new Random(); return new Long(rand.nextInt(123)); } else if (claz.equals(Integer.class) || claz.equals(int.class)) { Random rand = new Random(); return new Integer(rand.nextInt(123)); } else if (claz.equals(BigInteger.class)) { Random rand = new Random(); return new BigInteger(new BigInteger("1234567890123456789").bitLength(), rand); } else if (claz.equals(BigDecimal.class)) { Random rand = new Random(); return new BigDecimal(rand.nextInt(123)); } else if (claz.equals(Short.class) || claz.equals(short.class)) { Random rand = new Random(); return new Short((short) rand.nextInt(123)); }/*from w w w . jav a 2s. c om*/ } return null; }
From source file:com.xwtec.xwserver.util.json.JSONArray.java
/** * Construct a JSONArray from an short[].<br> * * @param array An short[] array.// w ww. j a va 2 s .c o m */ private static JSONArray _fromArray(short[] array, JsonConfig jsonConfig) { if (!addInstance(array)) { try { return jsonConfig.getCycleDetectionStrategy().handleRepeatedReferenceAsArray(array); } catch (JSONException jsone) { removeInstance(array); fireErrorEvent(jsone, jsonConfig); throw jsone; } catch (RuntimeException e) { removeInstance(array); JSONException jsone = new JSONException(e); fireErrorEvent(jsone, jsonConfig); throw jsone; } } fireArrayStartEvent(jsonConfig); JSONArray jsonArray = new JSONArray(); for (int i = 0; i < array.length; i++) { Number n = JSONUtils.transformNumber(new Short(array[i])); jsonArray.addValue(n, jsonConfig); fireElementAddedEvent(i, n, jsonConfig); } removeInstance(array); fireArrayEndEvent(jsonConfig); return jsonArray; }
From source file:com.znsx.cms.service.impl.DeviceManagerImpl.java
public String createPreset(String vicId, Integer presetNumber, String presetName) { Preset preset = new Preset(); preset.setDeviceId(vicId);/*www.j av a 2 s .c o m*/ preset.setName(presetName); preset.setPresetValue(presetNumber); preset.setIsDefault(new Short("0")); presetDAO.save(preset); return preset.getId(); }
From source file:net.sf.json.TestJSONArray.java
public void testToArray_Short() { Integer[] expected = new Integer[] { new Integer(1), new Integer(2) }; Short[] shorts = new Short[] { new Short((short) 1), new Short((short) 2) }; JSONArray jsonArray = JSONArray.fromObject(shorts); Object actual = JSONArray.toArray(jsonArray); Assertions.assertEquals(expected, actual); }
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:Arrays.java
/** * Converts array of shorts to Vector./* w ww .j a v a 2 s . co m*/ * * @param pasData array of short data * @return equivalent collection of Short objects * @since 0.3.0.3 */ public static Vector arrayToVector(final short[] pasData) { Vector oVector = new Vector(pasData.length); for (int i = 0; i < pasData.length; i++) { oVector.add(new Short(pasData[i])); } return oVector; }