edu.mit.jverbnet.index
Interface IVerbIndex

All Superinterfaces:
IHasLifecycle, java.lang.Iterable<IVerbClass>
All Known Implementing Classes:
VerbIndex

public interface IVerbIndex
extends IHasLifecycle, java.lang.Iterable<IVerbClass>

A verb index, usually Verbnet.

Since:
JVerbnet 1.0.0
Version:
1.2.0
Author:
Mark A. Finlayson

Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.mit.jverbnet.util.IHasLifecycle
IHasLifecycle.ObjectClosedException
 
Method Summary
 java.util.Set<IMember> getMembers(IWordnetKey key)
          Returns all members in the index with the specified wordnet key.
 java.util.Set<IMember> getMembers(java.lang.String grouping)
          Returns all members in the index with the specified grouping.
 IVerbClass getRootVerb(java.lang.String id)
          Returns the root verb class with the specified id, or null if no such verb class can be found in the index.
 IVerbClass getVerb(java.lang.String id)
          Returns the verb class with the specified id, or null if no such verb class can be found in the index.
 IVersion getVersion()
          The version of the index.
 java.util.Iterator<IVerbClass> iterator()
          Returns an iterator over all verb classes in the index, in the order they are encountered in the data files.
 java.util.Iterator<java.lang.String> iteratorGroups()
          Returns an iterator over all groupings in the index, in their natural order.
 java.util.Iterator<IVerbClass> iteratorRoots()
          Returns an iterator over all root verb classes in the index, in the order they are encountered in the data files.
 java.util.Iterator<IWordnetKey> iteratorWordnetKeys()
          Returns an iterator over all wordnet keys in the index, in their natural order.
 void setVersion(IVersion v)
          Sets the version for this index.
 
Methods inherited from interface edu.mit.jverbnet.util.IHasLifecycle
close, isOpen, open
 

Method Detail

getVersion

IVersion getVersion()
The version of the index. If the version cannot be determined, should return IVersion.UNKNOWN. If the version has not yet been determined, and the implementation does not determine the version automatically when called (e.g., the implementation requires a call to setVersion(IVersion)) the method will throw an exception.

Returns:
the version of the index, or IVersion.UNKNOWN
Throws:
java.lang.IllegalStateException - if the version needs to be set
Since:
JVerbnet 1.0.0

setVersion

void setVersion(IVersion v)
Sets the version for this index. May called at most once. If it is called a second time, it will throw an exception.

Parameters:
v - the version to use for this index; may not be null
Throws:
java.lang.NullPointerException - if the specified version is null
java.lang.IllegalStateException - if the method is called twice
Since:
JVerbnet 1.1.0

getVerb

IVerbClass getVerb(java.lang.String id)
Returns the verb class with the specified id, or null if no such verb class can be found in the index. Ids are usually of the form 'verb-##.#', e.g., 'accompany-51.7'.

Parameters:
id - the id of the class
Returns:
the verb with the specified id, or null if none
Throws:
java.lang.NullPointerException - if the specified id is null
java.lang.IllegalArgumentException - if the specified id is empty or all whitespace
Since:
JVerbnet 1.0.0

getRootVerb

IVerbClass getRootVerb(java.lang.String id)
Returns the root verb class with the specified id, or null if no such verb class can be found in the index. Ids are usually of the form 'verb-##.#', e.g., 'accompany-51.7'.

Parameters:
id - the id of the class
Returns:
the verb with the specified id, or null if none
Throws:
java.lang.NullPointerException - if the specified id is null
java.lang.IllegalArgumentException - if the specified id is empty or all whitespace
Since:
JVerbnet 1.0.0

getMembers

java.util.Set<IMember> getMembers(IWordnetKey key)
Returns all members in the index with the specified wordnet key. A null key indicates all members that have no key specified.

Parameters:
key - the key for which members should be retrieved; may be null
Returns:
a set of members with the specified wordnet keys, or an empty set if none; will never return null
Since:
JVerbnet 1.0.0

getMembers

java.util.Set<IMember> getMembers(java.lang.String grouping)
Returns all members in the index with the specified grouping. A null, empty, or all whitespace grouping indicates all members that have no grouping specified.

Parameters:
grouping - the grouping for which members should be retrieved; may be null, empty, or all whitespace.
Returns:
a set of members with the specified grouping, or an empty set if none; will never return null
Since:
JVerbnet 1.0.0

iterator

java.util.Iterator<IVerbClass> iterator()
Returns an iterator over all verb classes in the index, in the order they are encountered in the data files.

Specified by:
iterator in interface java.lang.Iterable<IVerbClass>
Returns:
an iterator over all verb classes in the index
Since:
JVerbnet 1.0.0

iteratorRoots

java.util.Iterator<IVerbClass> iteratorRoots()
Returns an iterator over all root verb classes in the index, in the order they are encountered in the data files.

Returns:
an iterator over all root verb classes in the index
Since:
JVerbnet 1.0.0

iteratorWordnetKeys

java.util.Iterator<IWordnetKey> iteratorWordnetKeys()
Returns an iterator over all wordnet keys in the index, in their natural order. The iterator will not return the 'null' wordnet key.

Returns:
an iterator over all wordnet keys in the index
Since:
JVerbnet 1.0.0

iteratorGroups

java.util.Iterator<java.lang.String> iteratorGroups()
Returns an iterator over all groupings in the index, in their natural order. The iterator will not return the 'null' grouping.

Returns:
an iterator over all wordnet keys in the index
Since:
JVerbnet 1.0.0


Copyright © 2012 ${project.organization.name}. All Rights Reserved.