edu.mit.jmwe.harness.result.error
Class CompositeErrorDetector

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<IErrorDetector>
          extended by edu.mit.jmwe.harness.result.error.CompositeErrorDetector
All Implemented Interfaces:
IHasID, IErrorDetector, Iterable<IErrorDetector>, Collection<IErrorDetector>, List<IErrorDetector>
Direct Known Subclasses:
CommonErrorDetector

public class CompositeErrorDetector
extends AbstractList<IErrorDetector>
implements IErrorDetector

Error detectors extending this class are composed of multiple simpler error detectors.

Since:
jMWE 1.0.0
Version:
$Id: CompositeErrorDetector.java 615 2011-05-07 00:02:36Z markaf $
Author:
N. Kulkarni

Field Summary
static String ID
          The ID for this error detector, "edu.mit.jmwe.error.composite"
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
CompositeErrorDetector(IErrorDetector... detectors)
          Constructs a composite error detector from an array of error detectors.
CompositeErrorDetector(List<? extends IErrorDetector> detectors)
          Constructs a composite error detector from a list of error detectors.
 
Method Summary
<T extends IToken,S extends IMarkedSentence<T>>
IErrorResult<T>
detect(ISentenceResult<T,S> result)
          Identifies the multi-word expressions in a unit result that fall under the specific error class this detector identifies.
 IErrorDetector get(int index)
           
 String getID()
          Returns an ID string that uniquely identifies this object or object type.
 int size()
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

ID

public static final String ID
The ID for this error detector, "edu.mit.jmwe.error.composite"

Since:
jMWE 1.0.0
See Also:
Constant Field Values
Constructor Detail

CompositeErrorDetector

public CompositeErrorDetector(IErrorDetector... detectors)
Constructs a composite error detector from an array of error detectors.

Parameters:
detectors - the array of error detectors. May not be null.
Throws:
NullPointerException - if the list of error detectors is null or contains null
IllegalArgumentException - if the specified array is empty
Since:
jMWE 1.0.0

CompositeErrorDetector

public CompositeErrorDetector(List<? extends IErrorDetector> detectors)
Constructs a composite error detector from a list of error detectors.

Parameters:
detectors - the list of error detectors. May not be null.
Throws:
NullPointerException - if the list of error detectors is null
Since:
jMWE 1.0.0
Method Detail

getID

public String getID()
Description copied from interface: IHasID
Returns an ID string that uniquely identifies this object or object type. Should never return null.

Specified by:
getID in interface IHasID
Returns:
the non-null id String

detect

public <T extends IToken,S extends IMarkedSentence<T>> IErrorResult<T> detect(ISentenceResult<T,S> result)
Description copied from interface: IErrorDetector
Identifies the multi-word expressions in a unit result that fall under the specific error class this detector identifies.

Specified by:
detect in interface IErrorDetector
Type Parameters:
T - the type of tokens contained in the unit.
S - the type of marked sentence whose results are stored. Is parameterized by tokens of type T.
Parameters:
result - the sentence result obtained by running an IMWEDetector over a unit
Returns:
an error result containing the MWEs identified by this error detector

get

public IErrorDetector get(int index)
Specified by:
get in interface List<IErrorDetector>
Specified by:
get in class AbstractList<IErrorDetector>

size

public int size()
Specified by:
size in interface Collection<IErrorDetector>
Specified by:
size in interface List<IErrorDetector>
Specified by:
size in class AbstractCollection<IErrorDetector>


Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.