edu.mit.jverbnet.data.syntax
Class SyntaxArgDesc

java.lang.Object
  extended by edu.mit.jverbnet.data.syntax.SyntaxArgDesc
All Implemented Interfaces:
ISyntaxArgDesc

public class SyntaxArgDesc
extends Object
implements ISyntaxArgDesc

Default implementation of ISyntaxArgDesc.

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

Constructor Summary
SyntaxArgDesc(INounPhraseType type, String value, ISelRestrictions<? extends IRestrType> selRestrs)
          Creates a new syntax argument description of the SyntaxArgType.NP type with the specified parameters.
SyntaxArgDesc(SyntaxArgType type, String value, INounPhraseType npType, ISelRestrictions<? extends IRestrType> selRestrs)
          Creates a new syntax argument description with full control.
SyntaxArgDesc(SyntaxArgType type, String value, ISelRestrictions<? extends IRestrType> selRestrs)
          Creates a new syntax argument description with the specified parameters.
 
Method Summary
 INounPhraseType getNounPhraseType()
          If the ISyntaxArgDesc.getType() method returns SyntaxArgType.NP, this method will return a noun phrase type.
 ISelRestrictions<? extends IRestrType> getSelRestrictions()
          Returns the selectional restrictions for this argument.
 SyntaxArgType getType()
          Returns the type of the syntactic argument.
 String getValue()
          Returns the value of the syntactic argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyntaxArgDesc

public SyntaxArgDesc(SyntaxArgType type,
                     String value,
                     ISelRestrictions<? extends IRestrType> selRestrs)
Creates a new syntax argument description with the specified parameters. May be used to create all syntax arguments other than those of the SyntaxArgType.NP type.

Parameters:
type - the type; may not be null or SyntaxArgType.NP
value - the value; must meet the restrictions of the type or an exception is thrown; see SyntaxArgType.VALUE_RULE.checkValue(String).
selRestrs - the selectional restrictions for this argument; may be null
Since:
JVerbnet 1.0.0

SyntaxArgDesc

public SyntaxArgDesc(INounPhraseType type,
                     String value,
                     ISelRestrictions<? extends IRestrType> selRestrs)
Creates a new syntax argument description of the SyntaxArgType.NP type with the specified parameters.

Parameters:
type - the noun phrase type
value - the value; must meet the restrictions of the type or an exception is thrown; see SyntaxArgType.VALUE_RULE.checkValue(String).
selRestrs - the selectional restrictions for this argument; may be null
Since:
JVerbnet 1.0.0

SyntaxArgDesc

public SyntaxArgDesc(SyntaxArgType type,
                     String value,
                     INounPhraseType npType,
                     ISelRestrictions<? extends IRestrType> selRestrs)
Creates a new syntax argument description with full control.

Parameters:
type - the type; may not be null
value - the value; must meet the restrictions of the type or an exception is thrown; see SyntaxArgType.VALUE_RULE.checkValue(String).
npType - must be non-null if the type is SyntaxArgType.NP; otherwise must be null
selRestrs - the selectional restrictions for this argument; may be null
Throws:
NullPointerException - if type is null; or if the type requires the value not to be null and the value is null
Since:
JVerbnet 1.0.0
Method Detail

getType

public SyntaxArgType getType()
Description copied from interface: ISyntaxArgDesc
Returns the type of the syntactic argument. Will never be null.

Specified by:
getType in interface ISyntaxArgDesc
Returns:
the non-null type of the syntactic argument

getValue

public String getValue()
Description copied from interface: ISyntaxArgDesc
Returns the value of the syntactic argument. May be null.

Specified by:
getValue in interface ISyntaxArgDesc
Returns:
the possibly null value of the syntactic argument

getNounPhraseType

public INounPhraseType getNounPhraseType()
Description copied from interface: ISyntaxArgDesc
If the ISyntaxArgDesc.getType() method returns SyntaxArgType.NP, this method will return a noun phrase type. Otherwise it will return null.

Specified by:
getNounPhraseType in interface ISyntaxArgDesc
Returns:
null if the type of the argument is not a noun phrase; otherwise a noun phrase type

getSelRestrictions

public ISelRestrictions<? extends IRestrType> getSelRestrictions()
Description copied from interface: ISyntaxArgDesc
Returns the selectional restrictions for this argument. Will never return null.

Specified by:
getSelRestrictions in interface ISyntaxArgDesc
Returns:
the selection restrictions for this argument


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