01: /* ====================================================================
02: Licensed to the Apache Software Foundation (ASF) under one or more
03: contributor license agreements. See the NOTICE file distributed with
04: this work for additional information regarding copyright ownership.
05: The ASF licenses this file to You under the Apache License, Version 2.0
06: (the "License"); you may not use this file except in compliance with
07: the License. You may obtain a copy of the License at
08:
09: 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 extends EscherSimpleProperty {
30: /**
31: * Create an instance of an escher boolean property.
32: *
33: * @param propertyNumber The property number (or id)
34: * @param value The 32 bit value of this bool property
35: */
36: public EscherBoolProperty(short propertyNumber, int value) {
37: super (propertyNumber, value);
38: }
39:
40: /**
41: * Whether this boolean property is true
42: */
43: public boolean isTrue() {
44: return propertyValue != 0;
45: }
46:
47: /**
48: * Whether this boolean property is false
49: */
50: public boolean isFalse() {
51: return propertyValue == 0;
52: }
53:
54: // public String toString()
55: // {
56: // return "propNum: " + getPropertyNumber()
57: // + ", complex: " + isComplex()
58: // + ", blipId: " + isBlipId()
59: // + ", value: " + (getValue() != 0);
60: // }
61:
62: }
|