KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > ddf > EscherBoolProperty


1
2 /* ====================================================================
3    Copyright 2002-2004 Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16 ==================================================================== */

17         
18 package org.apache.poi.ddf;
19
20 /**
21  * Represents a boolean property. The actual utility of this property is in doubt because many
22  * of the properties marked as boolean seem to actually contain special values. In other words
23  * they're not true booleans.
24  *
25  * @author Glen Stampoultzis
26  * @see EscherSimpleProperty
27  * @see EscherProperty
28  */

29 public class EscherBoolProperty
30         extends EscherSimpleProperty
31 {
32     /**
33      * Create an instance of an escher boolean property.
34      *
35      * @param propertyNumber The property number
36      * @param value The 32 bit value of this bool property
37      */

38     public EscherBoolProperty( short propertyNumber, int value )
39     {
40         super( propertyNumber, false, false, value );
41     }
42
43     /**
44      * Whether this boolean property is true
45      */

46     public boolean isTrue()
47     {
48         return propertyValue != 0;
49     }
50
51     /**
52      * Whether this boolean property is false
53      */

54     public boolean isFalse()
55     {
56         return propertyValue == 0;
57     }
58
59 // public String toString()
60
// {
61
// return "propNum: " + getPropertyNumber()
62
// + ", complex: " + isComplex()
63
// + ", blipId: " + isBlipId()
64
// + ", value: " + (getValue() != 0);
65
// }
66

67 }
68
Popular Tags