gate.creole.gazetteer
Class MappingDefinition
java.lang.Object
|
+--gate.util.AbstractFeatureBearer
|
+--gate.creole.AbstractResource
|
+--gate.creole.AbstractLanguageResource
|
+--gate.creole.gazetteer.MappingDefinition
- All Implemented Interfaces:
- Collection, FeatureBearer, LanguageResource, List, NameBearer, Resource, Serializable
- public class MappingDefinition
- extends AbstractLanguageResource
- implements List
Represents a mapping definition which maps gazetteer lists to ontology classes
- See Also:
- Serialized Form
Field Summary |
private static String |
ENCODING
the default encoding of the mapping |
private Set |
lists
set of gaz lists |
private List |
nodes
the list of nodes |
private Map |
nodesByList
mapping between a list and a node |
private URL |
url
the url of the mapping definition |
Methods inherited from class gate.creole.AbstractResource |
checkParameterValues, getName, getParameterValue, getParameterValue, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
Methods inherited from class java.lang.Object |
, clone, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
ENCODING
private static final String ENCODING
- the default encoding of the mapping
nodes
private List nodes
- the list of nodes
url
private URL url
- the url of the mapping definition
lists
private Set lists
- set of gaz lists
nodesByList
private Map nodesByList
- mapping between a list and a node
MappingDefinition
public MappingDefinition()
- Creates a new mapping definition
getUrls
public List getUrls()
- Gets the urls from this definition
- Returns:
- a list of all the ontology urls present in this mapping def
getURL
public URL getURL()
- Gets the url of this definition
- Returns:
- the url of the definition
setURL
public void setURL(URL aUrl)
- Sets the url of this definition
- Parameters:
aUrl
- the url of the definition
load
public void load()
throws ResourceInstantiationException,
InvalidFormatException
- Loads the mapping definition
- Throws:
ResourceInstantiationException
- if load fails.
store
public void store()
throws ResourceInstantiationException
- Stores the mapping definition
- Throws:
ResourceInstantiationException
- if store fails.
getLists
public Set getLists()
- Gets the gaz lists.
- Returns:
- set of the gazetteer lists
getNodeByList
public MappingNode getNodeByList(String list)
- Gets node by list
- Parameters:
list
- a gazetteer list filename- Returns:
- the mapping node that matches the list
size
public int size()
- Specified by:
size
in interface List
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface List
contains
public boolean contains(Object o)
- Specified by:
contains
in interface List
iterator
public Iterator iterator()
- Specified by:
iterator
in interface List
toArray
public Object[] toArray()
- Specified by:
toArray
in interface List
toArray
public Object[] toArray(Object[] a)
- Specified by:
toArray
in interface List
add
public boolean add(Object o)
- adds a new node, only if its list is new and uniquely mapped to this node.
- Specified by:
add
in interface List
- Parameters:
o
- a node- Returns:
- true if the list of node is not already mapped with another node.
add
public void add(int index,
Object o)
- adds a new node at the specified position, only if its list is new and uniquely mapped to this node.
- Specified by:
add
in interface List
- Parameters:
o
- a nodeindex
- position in the list
set
public Object set(int index,
Object o)
- Specified by:
set
in interface List
get
public Object get(int index)
- Specified by:
get
in interface List
remove
public boolean remove(Object o)
- Specified by:
remove
in interface List
remove
public Object remove(int index)
- Specified by:
remove
in interface List
containsAll
public boolean containsAll(Collection c)
- Specified by:
containsAll
in interface List
addAll
public boolean addAll(Collection c)
- Specified by:
addAll
in interface List
addAll
public boolean addAll(int index,
Collection c)
- Specified by:
addAll
in interface List
removeAll
public boolean removeAll(Collection c)
- Specified by:
removeAll
in interface List
retainAll
public boolean retainAll(Collection c)
- Specified by:
retainAll
in interface List
clear
public void clear()
- Specified by:
clear
in interface List
equals
public boolean equals(Object o)
- Specified by:
equals
in interface List
- Overrides:
equals
in class Object
subList
public List subList(int i1,
int i2)
- Specified by:
subList
in interface List
listIterator
public ListIterator listIterator(int index)
- Specified by:
listIterator
in interface List
listIterator
public ListIterator listIterator()
- Specified by:
listIterator
in interface List
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interface List
indexOf
public int indexOf(Object o)
- Specified by:
indexOf
in interface List