|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gate.util.AbstractFeatureBearer | +--gate.creole.AbstractResource | +--gate.creole.AbstractLanguageResource | +--gate.creole.gazetteer.LinearDefinition
Represents a Linear Definition [lists.def] file
The normal usage of the class will be
* construct it
* setURL
* load
* change
* store
Nested Class Summary | |
private class |
LinearDefinition.SafeIterator
SafeIterator class provides an iterator which is safe to be iterated and objects removed from it |
Field Summary | |
private String |
encoding
the encoding of the list |
private static String |
ENCODING
the default encoding of the definition |
private Map |
gazListsByNode
a map of gazetteer lists by nodes. |
private boolean |
isModified
flag whether the definition has been modified after loading |
private List |
lists
set of lists as strings |
private List |
nodes
the list of nodes |
private Map |
nodesByList
a mapping between a list and a node |
private URL |
url
the URL of the definition |
Fields inherited from class gate.creole.AbstractLanguageResource |
dataStore, lrPersistentId |
Fields inherited from class gate.creole.AbstractResource |
name |
Fields inherited from class gate.util.AbstractFeatureBearer |
features |
Constructor Summary | |
LinearDefinition()
|
Method Summary | |
void |
add(int index,
Object o)
|
boolean |
add(Object o)
adds a new node, only if its list is new and uniquely mapped to this node. |
boolean |
addAll(Collection c)
|
boolean |
addAll(int index,
Collection c)
|
void |
clear()
|
boolean |
contains(Object o)
|
boolean |
containsAll(Collection c)
|
boolean |
equals(Object o)
|
Object |
get(int index)
|
String |
getEncoding()
Gets the encoding of the linear def |
Set |
getLanguages()
Gets the set of all languages in this definition |
List |
getLists()
Gets gazetteer lists of this definition. |
Map |
getListsByNode()
Gets the lists by node map |
Set |
getMajors()
Gets the set of all major types in this definition |
Set |
getMinors()
Gets the set of all minor types in this definition |
List |
getNodes()
get the nodes of the definition as a list |
Map |
getNodesByListNames()
Gets a map of lists names vs nodes |
URL |
getURL()
Gets the url of this linear definition |
int |
indexOf(Object o)
|
boolean |
isEmpty()
|
boolean |
isModified()
Gets the value of the isModified flag. |
Iterator |
iterator()
|
int |
lastIndexOf(Object o)
|
ListIterator |
listIterator()
|
ListIterator |
listIterator(int index)
|
void |
load()
Loads linear definition if url is set |
Map |
loadLists()
Loads the gazetteer lists and maps them to the nodes |
GazetteerList |
loadSingleList(String listName)
Loads a single gazetteer list given a name |
Object |
remove(int index)
|
boolean |
remove(Object o)
|
boolean |
removeAll(Collection c)
|
boolean |
retainAll(Collection c)
|
Object |
set(int index,
Object element)
|
void |
setEncoding(String encod)
Sets the encoding of the linear def |
void |
setURL(URL aUrl)
Sets the url of this linear definition |
int |
size()
|
void |
store()
Stores this to a definition file. |
List |
subList(int fromIndex,
int toIndex)
|
Object[] |
toArray()
|
Object[] |
toArray(Object[] a)
|
Methods inherited from class gate.creole.AbstractLanguageResource |
cleanup, getDataStore, getLRPersistenceId, getParent, setDataStore, setLRPersistenceId, setParent, sync |
Methods inherited from class gate.creole.AbstractResource |
checkParameterValues, getName, getParameterValue, getParameterValue, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
Methods inherited from class gate.util.AbstractFeatureBearer |
getFeatures, setFeatures |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.List |
hashCode |
Methods inherited from interface gate.Resource |
getParameterValue, init, setParameterValue, setParameterValues |
Methods inherited from interface gate.util.FeatureBearer |
getFeatures, setFeatures |
Methods inherited from interface gate.util.NameBearer |
getName, setName |
Field Detail |
private static final String ENCODING
private List nodes
private URL url
private List lists
private String encoding
private Map nodesByList
private Map gazListsByNode
private boolean isModified
Constructor Detail |
public LinearDefinition()
Method Detail |
public void setEncoding(String encod)
encod
- the encoding to be setpublic String getEncoding()
public Map loadLists() throws ResourceInstantiationException
ResourceInstantiationException
public GazetteerList loadSingleList(String listName) throws ResourceInstantiationException
listName
- the name of the list to be loaded
ResourceInstantiationException
public Map getListsByNode()
public Map getNodesByListNames()
public boolean isModified()
isModified
in interface LanguageResource
isModified
in class AbstractLanguageResource
public URL getURL()
public void setURL(URL aUrl)
aUrl
- the url of this linear definitionpublic void load() throws ResourceInstantiationException
ResourceInstantiationException
public void store() throws ResourceInstantiationException
ResourceInstantiationException
public List getLists()
public List getNodes()
public Set getMajors()
public Set getMinors()
public Set getLanguages()
public boolean addAll(int index, Collection c)
addAll
in interface List
public Object get(int index)
get
in interface List
public Object set(int index, Object element)
set
in interface List
public void add(int index, Object o)
add
in interface List
public Object remove(int index)
remove
in interface List
public int indexOf(Object o)
indexOf
in interface List
public int lastIndexOf(Object o)
lastIndexOf
in interface List
public ListIterator listIterator()
listIterator
in interface List
public ListIterator listIterator(int index)
listIterator
in interface List
public List subList(int fromIndex, int toIndex)
subList
in interface List
public int size()
size
in interface List
public boolean isEmpty()
isEmpty
in interface List
public boolean contains(Object o)
contains
in interface List
public Iterator iterator()
iterator
in interface List
public Object[] toArray()
toArray
in interface List
public Object[] toArray(Object[] a)
toArray
in interface List
public boolean add(Object o)
add
in interface List
o
- a node
public boolean remove(Object o)
remove
in interface List
public boolean containsAll(Collection c)
containsAll
in interface List
public boolean addAll(Collection c)
addAll
in interface List
public boolean removeAll(Collection c)
removeAll
in interface List
public boolean retainAll(Collection c)
retainAll
in interface List
public void clear()
clear
in interface List
public boolean equals(Object o)
equals
in interface List
equals
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |