2
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3
* Copyright (C) 2007 - INRIA - Allan CORNET
4
* Copyright (C) 2007 - INRIA - Sylvestre LEDRU
6
* This file must be used under the terms of the CeCILL.
7
* This source file is licensed as described in the file COPYING, which
8
* you should have received as part of this distribution. The terms
9
* are also available at
10
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
17
* Scilab Boolean object
18
* See SCI/modules/javasci/examples/others for some simple examples
19
* @author Allan CORNET - INRIA 2007
20
* @author Sylvestre LEDRU - INRIA 2007
22
public class SciBoolean extends SciAbstractDataType implements java.io.Serializable
24
private String typeDescription = "boolean";
27
* Constructs a Scilab Boolean from a other SciBoolean
29
* @param name the name of the Scilab variable
30
* @param booleanObj the Sciboolean you want to copy
32
public SciBoolean(String name, SciBoolean booleanObj) {
33
boolean[] pTmpBooleanArray = new boolean[1];
34
pTmpBooleanArray[0] = booleanObj.getData();
35
sciArray = new SciBooleanArray(name, 1, 1, pTmpBooleanArray);
39
* Constructs a Scilab Boolean
41
* @param name the name of the Scilab variable
43
public SciBoolean(String name) {
44
sciArray = new SciBooleanArray(name, 1, 1);
49
* Constructs a Scilab Boolean from a java boolean
51
* @param name the name of the Scilab variable
52
* @param value the boolean value
54
public SciBoolean(String name, boolean value) {
55
boolean[] pTmpBooleanArray = new boolean[1];
56
pTmpBooleanArray[0] = value;
57
sciArray = new SciBooleanArray(name, 1, 1, pTmpBooleanArray);
61
* Returns the boolean value
65
public boolean getData() {
67
boolean[] pTmpBooleanArray = ((SciBooleanArray) sciArray).getData();
68
return pTmpBooleanArray[0];
72
* Return the description of the DataType
73
* Description must set in any class which extends SciAbstractDataType
75
* @return the Description
78
public String getTypeDescription() {
79
return this.typeDescription;
83
/********************************************************************************************************/