| LanguageResource.java |
1 /*
2 * LanguageResource.java
3 *
4 * Copyright (c) 1998-2005, The University of Sheffield.
5 *
6 * This file is part of GATE (see http://gate.ac.uk/), and is free
7 * software, licenced under the GNU Library General Public License,
8 * Version 2, June 1991 (in the distribution as file licence.html,
9 * and also available at http://gate.ac.uk/gate/licence.html).
10 *
11 * Hamish Cunningham, 11/Feb/2000
12 *
13 * $Id: LanguageResource.java,v 1.14 2005/01/11 13:51:30 ian Exp $
14 */
15
16 package gate;
17
18 import gate.persist.PersistenceException;
19 import gate.security.SecurityException;
20
21 /** Models all sorts of language resources.
22 */
23 public interface LanguageResource extends Resource
24 {
25 /** Get the data store that this LR lives in. Null for transient LRs. */
26 public DataStore getDataStore();
27
28 /** Set the data store that this LR lives in. */
29 public void setDataStore(DataStore dataStore) throws PersistenceException;
30
31 /** Returns the persistence id of this LR, if it has been stored in
32 * a datastore. Null otherwise.
33 */
34 public Object getLRPersistenceId();
35
36 /** Sets the persistence id of this LR. To be used only in the
37 * Factory and DataStore code.
38 */
39 public void setLRPersistenceId(Object lrID);
40
41 /** Save: synchonise the in-memory image of the LR with the persistent
42 * image.
43 */
44 public void sync() throws PersistenceException,SecurityException;
45
46 /**
47 * Returns true of an LR has been modified since the last sync.
48 * Always returns false for transient LRs.
49 */
50 public boolean isModified();
51
52 /**
53 * Returns the parent LR of this LR.
54 * Only relevant for LRs that support shadowing. Most do not by default.
55 */
56 public LanguageResource getParent()
57 throws PersistenceException,SecurityException;
58
59 /**
60 * Sets the parent LR of this LR.
61 * Only relevant for LRs that support shadowing. Most do not by default.
62 */
63 public void setParent(LanguageResource parentLR)
64 throws PersistenceException,SecurityException;
65
66 } // interface LanguageResource
67