1   /*
2    *  LanguageResource.java
3    *
4    *  Copyright (c) 1998-2001, 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.11 2001/12/05 17:51:20 kalina Exp $
14   */
15  
16  package gate;
17  
18  import java.util.*;
19  import java.io.*;
20  
21  import gate.util.*;
22  import gate.persist.*;
23  import gate.security.SecurityException;
24  
25  /** Models all sorts of language resources.
26    */
27  public interface LanguageResource extends Resource
28  {
29    /** Get the data store that this LR lives in. Null for transient LRs. */
30    public DataStore getDataStore();
31  
32    /** Set the data store that this LR lives in. */
33    public void setDataStore(DataStore dataStore) throws PersistenceException;
34  
35    /** Returns the persistence id of this LR, if it has been stored in
36     *  a datastore. Null otherwise.
37     */
38    public Object getLRPersistenceId();
39  
40    /** Sets the persistence id of this LR. To be used only in the
41     *  Factory and DataStore code.
42     */
43    public void setLRPersistenceId(Object lrID);
44  
45    /** Save: synchonise the in-memory image of the LR with the persistent
46      * image.
47      */
48    public void sync() throws PersistenceException,SecurityException;
49  
50    /**
51     * Returns true of an LR has been modified since the last sync.
52     * Always returns false for transient LRs.
53     */
54    public boolean isModified();
55  
56    /**
57     * Returns the parent LR of this LR.
58     * Only relevant for LRs that support shadowing. Most do not by default.
59     */
60    public LanguageResource getParent()
61      throws PersistenceException,SecurityException;
62  
63    /**
64     * Sets the parent LR of this LR.
65     * Only relevant for LRs that support shadowing. Most do not by default.
66     */
67    public void setParent(LanguageResource parentLR)
68      throws PersistenceException,SecurityException;
69  
70  } // interface LanguageResource
71