01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.sail.memory.model;
07:
08: import org.openrdf.model.vocabulary.XMLSchema;
09:
10: /**
11: * An extension of MemLiteral that stores a boolean value to avoid parsing.
12: *
13: * @author David Huynh
14: * @author Arjohn Kampman
15: */
16: public class BooleanMemLiteral extends MemLiteral {
17:
18: /*-----------*
19: * Variables *
20: *-----------*/
21:
22: /**
23: *
24: */
25: private static final long serialVersionUID = 8061173551677475700L;
26:
27: private boolean b;
28:
29: /*--------------*
30: * Constructors *
31: *--------------*/
32:
33: public BooleanMemLiteral(Object creator, boolean b) {
34: this (creator, Boolean.toString(b), b);
35: }
36:
37: public BooleanMemLiteral(Object creator, String label, boolean b) {
38: super (creator, label, XMLSchema.BOOLEAN);
39: this .b = b;
40: }
41:
42: /*---------*
43: * Methods *
44: *---------*/
45:
46: @Override
47: public boolean booleanValue() {
48: return b;
49: }
50: }
|