01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.query.impl;
07:
08: import org.openrdf.model.Value;
09: import org.openrdf.query.BindingSet;
10: import org.openrdf.query.Dataset;
11: import org.openrdf.query.Query;
12:
13: /**
14: * Abstract super class of all query types.
15: */
16: public abstract class AbstractQuery implements Query {
17:
18: /*-----------*
19: * Variables *
20: *-----------*/
21:
22: protected MapBindingSet bindings = new MapBindingSet();
23:
24: protected Dataset dataset = null;
25:
26: protected boolean includeInferred = true;
27:
28: /*--------------*
29: * Constructors *
30: *--------------*/
31:
32: /**
33: * Creates a new query object.
34: */
35: protected AbstractQuery() {
36: }
37:
38: /*---------*
39: * Methods *
40: *---------*/
41:
42: public void setBinding(String name, Value value) {
43: bindings.addBinding(name, value);
44: }
45:
46: public void removeBinding(String name) {
47: bindings.removeBinding(name);
48: }
49:
50: public BindingSet getBindings() {
51: return bindings;
52: }
53:
54: public void setDataset(Dataset dataset) {
55: this .dataset = dataset;
56: }
57:
58: public Dataset getDataset() {
59: return dataset;
60: }
61:
62: public void setIncludeInferred(boolean includeInferred) {
63: this .includeInferred = includeInferred;
64: }
65:
66: public boolean getIncludeInferred() {
67: return includeInferred;
68: }
69: }
|