GATE
Version 3.1-2270

gate.creole.gazetteer
Class MappingDefinition

java.lang.Object
  extended by gate.util.AbstractFeatureBearer
      extended by gate.creole.AbstractResource
          extended by gate.creole.AbstractLanguageResource
              extended by gate.creole.gazetteer.MappingDefinition
All Implemented Interfaces:
LanguageResource, Resource, FeatureBearer, NameBearer, Serializable, Iterable, Collection, List

public class MappingDefinition
extends AbstractLanguageResource
implements List

Represents a mapping definition which maps gazetteer lists to ontology classes

See Also:
Serialized Form

Field Summary
 
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
MappingDefinition()
          Creates a new mapping definition
 
Method Summary
 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.
 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)
           
 Set getLists()
          Gets the gaz lists.
 MappingNode getNodeByList(String list)
          Gets node by list
 URL getURL()
          Gets the url of this definition
 List getUrls()
          Gets the urls from this definition
 int indexOf(Object o)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 void load()
          Loads the mapping definition
 Object remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 Object set(int index, Object o)
           
 void setURL(URL aUrl)
          Sets the url of this definition
 int size()
           
 void store()
          Stores the mapping definition
 List subList(int i1, int i2)
           
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 
Methods inherited from class gate.creole.AbstractLanguageResource
cleanup, getDataStore, getLRPersistenceId, getParent, isModified, 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
 

Constructor Detail

MappingDefinition

public MappingDefinition()
Creates a new mapping definition

Method Detail

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.
InvalidFormatException

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 Collection
Specified by:
size in interface List

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface List

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface List

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface List

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection
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 Collection
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 node
index - 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 Collection
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 Collection
Specified by:
containsAll in interface List

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection
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 Collection
Specified by:
removeAll in interface List

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface List

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection
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

GATE
Version 3.1-2270