public class LinearDefinition extends AbstractLanguageResource implements List<LinearNode>
dataStore, lrPersistentId
name
features
Constructor and Description |
---|
LinearDefinition() |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
LinearNode ln)
Add a node to this LinearDefinition.
|
boolean |
add(LinearNode o)
Adds a new node, only if its list is new and uniquely mapped to
this node.
|
boolean |
addAll(Collection<? extends LinearNode> c) |
boolean |
addAll(int index,
Collection<? extends LinearNode> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object obj) |
LinearNode |
get(int index) |
String |
getEncoding()
Gets the encoding of the linear def
|
Set<String> |
getLanguages()
Gets the set of all languages in this definition
|
List<String> |
getLists()
Gets gazetteer lists of this definition. note that a new list is
created so the adding and removing of lists will not affect the
internal members.
|
Map<LinearNode,GazetteerList> |
getListsByNode()
Gets the lists by node map
|
Set<String> |
getMajors()
Gets the set of all major types in this definition
|
Set<String> |
getMinors()
Gets the set of all minor types in this definition
|
List<LinearNode> |
getNodes()
get the nodes of the definition as a list
|
Map<String,LinearNode> |
getNodesByListNames()
Gets a map of lists names vs nodes
|
String |
getSeparator() |
URL |
getURL()
Gets the url of this linear definition
|
int |
hashCode() |
int |
indexOf(Object o) |
boolean |
isEmpty() |
boolean |
isModified()
Gets the value of the isModified flag.
|
Iterator<LinearNode> |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator<LinearNode> |
listIterator() |
ListIterator<LinearNode> |
listIterator(int index) |
void |
load()
Loads linear definition if url is set
|
Map<LinearNode,GazetteerList> |
loadLists()
Loads the gazetteer lists and maps them to the nodes
|
Map<LinearNode,GazetteerList> |
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
|
GazetteerList |
loadSingleList(String listName,
boolean isOrdered)
Loads a single gazetteer list given a name
|
LinearNode |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
LinearNode |
set(int index,
LinearNode 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<LinearNode> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
cleanup, getDataStore, getLRPersistenceId, getParent, setDataStore, setLRPersistenceId, setParent, sync
checkParameterValues, flushBeanInfoCache, forgetBeanInfo, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners, toString
getFeatures, setFeatures
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getParameterValue, init, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
public LinearDefinition()
public void setEncoding(String encod)
encod
- the encoding to be setpublic String getEncoding()
public Map<LinearNode,GazetteerList> loadLists() throws ResourceInstantiationException
ResourceInstantiationException
- when the resource cannot be
createdpublic Map<LinearNode,GazetteerList> loadLists(boolean isOrdered) throws ResourceInstantiationException
isOrdered
- true if the feature maps used should be orderedResourceInstantiationException
- when the resource cannot be
createdpublic GazetteerList loadSingleList(String listName) throws ResourceInstantiationException
listName
- the name of the list to be loadedResourceInstantiationException
public GazetteerList loadSingleList(String listName, boolean isOrdered) throws ResourceInstantiationException
listName
- the name of the list to be loadedisOrdered
- true if the feature maps used should be orderedResourceInstantiationException
public Map<LinearNode,GazetteerList> getListsByNode()
public Map<String,LinearNode> getNodesByListNames()
public boolean isModified()
isModified
in interface LanguageResource
isModified
in class AbstractLanguageResource
public void setModified(boolean modified)
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<String> getLists()
public List<LinearNode> getNodes()
public Set<String> getMajors()
public Set<String> getMinors()
public Set<String> getLanguages()
public boolean addAll(int index, Collection<? extends LinearNode> c)
addAll
in interface List<LinearNode>
public LinearNode get(int index)
get
in interface List<LinearNode>
public LinearNode set(int index, LinearNode element)
set
in interface List<LinearNode>
public void add(int index, LinearNode ln)
NOTE: this will throw a GateRuntimeException if anything goes wrong when reading the list.
add
in interface List<LinearNode>
index
- ln
- public LinearNode remove(int index)
remove
in interface List<LinearNode>
public int indexOf(Object o)
indexOf
in interface List<LinearNode>
public int lastIndexOf(Object o)
lastIndexOf
in interface List<LinearNode>
public ListIterator<LinearNode> listIterator()
listIterator
in interface List<LinearNode>
public ListIterator<LinearNode> listIterator(int index)
listIterator
in interface List<LinearNode>
public List<LinearNode> subList(int fromIndex, int toIndex)
subList
in interface List<LinearNode>
public int size()
size
in interface Collection<LinearNode>
size
in interface List<LinearNode>
public boolean isEmpty()
isEmpty
in interface Collection<LinearNode>
isEmpty
in interface List<LinearNode>
public boolean contains(Object o)
contains
in interface Collection<LinearNode>
contains
in interface List<LinearNode>
public Iterator<LinearNode> iterator()
iterator
in interface Iterable<LinearNode>
iterator
in interface Collection<LinearNode>
iterator
in interface List<LinearNode>
public Object[] toArray()
toArray
in interface Collection<LinearNode>
toArray
in interface List<LinearNode>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<LinearNode>
toArray
in interface List<LinearNode>
public boolean add(LinearNode o)
NOTE: this will throw a GateRuntimeException if anything goes wrong reading the list.
add
in interface Collection<LinearNode>
add
in interface List<LinearNode>
o
- a nodepublic boolean remove(Object o)
remove
in interface Collection<LinearNode>
remove
in interface List<LinearNode>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<LinearNode>
containsAll
in interface List<LinearNode>
public boolean addAll(Collection<? extends LinearNode> c)
addAll
in interface Collection<LinearNode>
addAll
in interface List<LinearNode>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<LinearNode>
removeAll
in interface List<LinearNode>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<LinearNode>
retainAll
in interface List<LinearNode>
public void clear()
clear
in interface Collection<LinearNode>
clear
in interface List<LinearNode>
public int hashCode()
hashCode
in interface Collection<LinearNode>
hashCode
in interface List<LinearNode>
hashCode
in class Object
public boolean equals(Object obj)
equals
in interface Collection<LinearNode>
equals
in interface List<LinearNode>
equals
in class Object
public String getSeparator()
public void setSeparator(String separator)
separator
- the separator to set