|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.util.AbstractFeatureBearer
gate.creole.AbstractResource
gate.creole.AbstractLanguageResource
gate.creole.gazetteer.LinearDefinition
public class 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. this is loaded on loadLists |
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 String |
separator
the separator used to delimit feature name-value pairs in gazetteer lists |
private static long |
serialVersionUID
|
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 |
String |
getSeparator()
|
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 |
Map |
loadLists(boolean isOrdered)
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 |
setModified(boolean modified)
|
void |
setSeparator(String separator)
|
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, getBeanInfo, 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 long serialVersionUID
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
private String separator
| 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 - when the resource cannot be created
public Map loadLists(boolean isOrdered)
throws ResourceInstantiationException
isOrdered - true if the feature maps used should be ordered
ResourceInstantiationException - when the resource cannot be created
public GazetteerList loadSingleList(String listName)
throws ResourceInstantiationException
listName - the name of the list to be loaded
ResourceInstantiationExceptionpublic Map getListsByNode()
public Map getNodesByListNames()
public boolean isModified()
isModified in interface LanguageResourceisModified in class AbstractLanguageResourcepublic void setModified(boolean modified)
public URL getURL()
public void setURL(URL aUrl)
aUrl - the url of this linear definition
public void load()
throws ResourceInstantiationException
ResourceInstantiationException
public void store()
throws ResourceInstantiationException
ResourceInstantiationExceptionpublic List getLists()
public List getNodes()
public Set getMajors()
public Set getMinors()
public Set getLanguages()
public boolean addAll(int index,
Collection c)
addAll in interface Listpublic 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 Listpublic Object remove(int index)
remove in interface Listpublic int indexOf(Object o)
indexOf in interface Listpublic int lastIndexOf(Object o)
lastIndexOf in interface Listpublic ListIterator listIterator()
listIterator in interface Listpublic ListIterator listIterator(int index)
listIterator in interface List
public List subList(int fromIndex,
int toIndex)
subList in interface Listpublic int size()
size in interface Collectionsize in interface Listpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface Listpublic boolean contains(Object o)
contains in interface Collectioncontains in interface Listpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Listpublic Object[] toArray()
toArray in interface CollectiontoArray in interface Listpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface Listpublic boolean add(Object o)
add in interface Collectionadd in interface Listo - a node
public boolean remove(Object o)
remove in interface Collectionremove in interface Listpublic boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface Listpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface Listpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface Listpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface Listpublic void clear()
clear in interface Collectionclear in interface Listpublic boolean equals(Object o)
equals in interface Collectionequals in interface Listequals in class Objectpublic String getSeparator()
public void setSeparator(String separator)
separator - the separator to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||