public class GazetteerList extends AbstractLanguageResource implements List<GazetteerNode>
Modifier and Type | Field and Description |
---|---|
static int |
LIST_MODE
indicates list representation of the gazetteer list
|
static int |
STRING_MODE
indicates representation of the gaz list as a single string
|
dataStore, lrPersistentId
name
features
Constructor and Description |
---|
GazetteerList()
create a new gazetteer list
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(GazetteerNode o) |
void |
add(int index,
GazetteerNode element) |
boolean |
addAll(Collection<? extends GazetteerNode> c)
Adds entire collection
|
boolean |
addAll(int index,
Collection<? extends GazetteerNode> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object obj) |
GazetteerNode |
get(int index) |
String |
getEncoding()
Gets the encoding of the list
|
int |
getMode()
Retrieves the current mode of the gaz list
|
String |
getSeparator() |
URL |
getURL()
Gets the URL of the list
|
int |
hashCode() |
int |
indexOf(Object o) |
boolean |
isEmpty() |
boolean |
isModified()
Returns true of an LR has been modified since the last sync.
|
Iterator<GazetteerNode> |
iterator()
Gets an iterator over the list.
|
int |
lastIndexOf(Object o) |
ListIterator<GazetteerNode> |
listIterator() |
ListIterator<GazetteerNode> |
listIterator(int index) |
void |
load()
Loads a gazetteer list
|
void |
load(boolean isOrdered)
Loads a gazetteer list
|
GazetteerNode |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
GazetteerNode |
set(int index,
GazetteerNode element) |
void |
setEncoding(String encod)
Sets the encoding of the list
|
void |
setMode(int m)
Sets mode of the gazetteer list
|
void |
setModified(boolean modified)
Sets the modified status of the current list
|
void |
setSeparator(String separator) |
void |
setURL(URL theUrl)
Sets the URL of the list
|
int |
size() |
void |
store()
Stores the list to the specified url
|
List<GazetteerNode> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString()
Retrieves the string representation of the gaz list according to
its mode.
|
void |
updateContent(String newContent)
Updates the content of the gaz list with the given parameter.
|
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
getFeatures, setFeatures
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getParameterValue, init, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
public static final int LIST_MODE
public static final int STRING_MODE
public GazetteerList()
public boolean isModified()
AbstractLanguageResource
isModified
in interface LanguageResource
isModified
in class AbstractLanguageResource
public void setModified(boolean modified)
modified
- is modified flagpublic int getMode()
public void setMode(int m)
m
- the mode to be setpublic void setEncoding(String encod)
encod
- the encoding to be setpublic String getEncoding()
public void load() throws ResourceInstantiationException
ResourceInstantiationException
- when the resource cannot be
createdpublic void load(boolean isOrdered) throws ResourceInstantiationException
isOrdered
- true if the feature maps used should be orderedResourceInstantiationException
- when the resource cannot be
createdpublic void store() throws ResourceInstantiationException
ResourceInstantiationException
public void setURL(URL theUrl)
theUrl
- the URL of the Listpublic String getSeparator()
public void setSeparator(String separator)
separator
- the separator to setpublic int size()
size
in interface Collection<GazetteerNode>
size
in interface List<GazetteerNode>
public boolean isEmpty()
isEmpty
in interface Collection<GazetteerNode>
isEmpty
in interface List<GazetteerNode>
public boolean contains(Object o)
contains
in interface Collection<GazetteerNode>
contains
in interface List<GazetteerNode>
public Iterator<GazetteerNode> iterator()
iterator
in interface Iterable<GazetteerNode>
iterator
in interface Collection<GazetteerNode>
iterator
in interface List<GazetteerNode>
public Object[] toArray()
toArray
in interface Collection<GazetteerNode>
toArray
in interface List<GazetteerNode>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<GazetteerNode>
toArray
in interface List<GazetteerNode>
public boolean add(GazetteerNode o)
add
in interface Collection<GazetteerNode>
add
in interface List<GazetteerNode>
public boolean remove(Object o)
remove
in interface Collection<GazetteerNode>
remove
in interface List<GazetteerNode>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<GazetteerNode>
containsAll
in interface List<GazetteerNode>
public boolean addAll(Collection<? extends GazetteerNode> c)
addAll
in interface Collection<GazetteerNode>
addAll
in interface List<GazetteerNode>
c
- a collection to be adddedpublic boolean addAll(int index, Collection<? extends GazetteerNode> c)
addAll
in interface List<GazetteerNode>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<GazetteerNode>
removeAll
in interface List<GazetteerNode>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<GazetteerNode>
retainAll
in interface List<GazetteerNode>
public void clear()
clear
in interface Collection<GazetteerNode>
clear
in interface List<GazetteerNode>
public int hashCode()
hashCode
in interface Collection<GazetteerNode>
hashCode
in interface List<GazetteerNode>
hashCode
in class Object
public boolean equals(Object obj)
equals
in interface Collection<GazetteerNode>
equals
in interface List<GazetteerNode>
equals
in class Object
public GazetteerNode get(int index)
get
in interface List<GazetteerNode>
public GazetteerNode set(int index, GazetteerNode element)
set
in interface List<GazetteerNode>
public void add(int index, GazetteerNode element)
add
in interface List<GazetteerNode>
public GazetteerNode remove(int index)
remove
in interface List<GazetteerNode>
public int indexOf(Object o)
indexOf
in interface List<GazetteerNode>
public int lastIndexOf(Object o)
lastIndexOf
in interface List<GazetteerNode>
public ListIterator<GazetteerNode> listIterator()
listIterator
in interface List<GazetteerNode>
public ListIterator<GazetteerNode> listIterator(int index)
listIterator
in interface List<GazetteerNode>
public List<GazetteerNode> subList(int fromIndex, int toIndex)
subList
in interface List<GazetteerNode>
public String toString()
LIST_MODE
then all the entries are dumped
sequentially to a string. If STRING_MODE
then the content
(a string) of the gaz list is retrieved.toString
in class AbstractResource
public void updateContent(String newContent)
LIST_MODE
the new content is parsed and loaded as single
nodes through the List
interface. In the case of
STRING_MODE
the new content is stored as a String and is
not parsed.newContent
- the new content of the gazetteer list