View Javadoc

1   /*
2    * $Id: DBStatement.java,v 1.1 2004/07/25 19:10:08 roku Exp $
3    * 
4    * Copyright 2004 University of Hannover
5    * 
6    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7    * use this file except in compliance with the License. You may obtain a copy of
8    * the License at
9    * 
10   * http://www.apache.org/licenses/LICENSE-2.0
11   * 
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15   * License for the specific language governing permissions and limitations under
16   * the License.
17   */
18  
19  package olr.statementpool;
20  
21  import olr.rdf.Attribute;
22  
23  public class DBStatement extends ExtStatement
24  {
25  
26      public DBStatement(String subject, String predicate, String object,
27              int DBstatementID)
28      {
29          super(subject, predicate, object);
30          this.DBstatementID = 0;
31          modified = false;
32          this.DBstatementID = DBstatementID;
33      }
34  
35      public DBStatement(String subject, Attribute attribute, int DBstatementID)
36      {
37          super(subject, attribute.getPredicate(), attribute.getObject(),
38                  attribute.getID());
39          this.DBstatementID = 0;
40          modified = false;
41          this.DBstatementID = DBstatementID;
42      }
43  
44      public int getDBstatementID()
45      {
46          return DBstatementID;
47      }
48  
49      public void setDBstatementID(int DBstatementID)
50      {
51          this.DBstatementID = DBstatementID;
52      }
53  
54      public boolean isPublic()
55      {
56          return super.isPublic;
57      }
58  
59      public void setPublic(boolean isPublic)
60      {
61          super.isPublic = isPublic;
62      }
63  
64      public boolean isModified()
65      {
66          return modified;
67      }
68  
69      public void saved()
70      {
71          modified = false;
72      }
73  
74      public void setObject(String object)
75      {
76          if (!getObject().equals(object))
77          {
78              super.setObject(object);
79              modified = true;
80          }
81      }
82  
83      private int     DBstatementID;
84  
85      private boolean modified;
86  }