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 java.lang.Object
implements ISyntaxArgDesc

Default implementation of ISyntaxArgDesc.

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

Nested Class Summary
static class SyntaxArgDesc.SyntaxArgDescBuilder
          Default implementation of syntax arg descriptor builder interface.
 
Nested classes/interfaces inherited from interface edu.mit.jverbnet.data.syntax.ISyntaxArgDesc
ISyntaxArgDesc.ISyntaxArgDescBuilder
 
Constructor Summary
SyntaxArgDesc(ISyntaxDesc parent, INounPhraseType type, java.lang.String value, ISelRestrictions<? extends IRestrType> selRestrs)
          Creates a new syntax argument description of the SyntaxArgType.NP type with the specified parameters.
SyntaxArgDesc(ISyntaxDesc parent, SyntaxArgType type, java.lang.String value, INounPhraseType npType, ISelRestrictions<? extends IRestrType> selRestrs)
          Creates a new syntax argument description with full control.
SyntaxArgDesc(ISyntaxDesc parent, SyntaxArgType type, java.lang.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.
 ISyntaxDesc getParent()
          Returns the parent of this argument
 ISelRestrictions<? extends IRestrType> getSelRestrictions()
          Returns the selectional restrictions for this argument.
 SyntaxArgType getType()
          Returns the type of the syntactic argument.
 java.lang.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(ISyntaxDesc parent,
                     SyntaxArgType type,
                     java.lang.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:
parent - the syntax descriptor parent of this argument; may not be null
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.2.0

SyntaxArgDesc

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

Parameters:
parent - the syntax descriptor parent of this argument; may not be null
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.2.0

SyntaxArgDesc

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

Parameters:
parent - the syntax descriptor parent of this argument; may not be null
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:
java.lang.NullPointerException - if type is null; or if the type requires the value not to be null and the value is null
Since:
JVerbnet 1.2.0
Method Detail

getParent

public ISyntaxDesc getParent()
Description copied from interface: ISyntaxArgDesc
Returns the parent of this argument

Specified by:
getParent in interface ISyntaxArgDesc
Returns:
the parent of this argument, never null.

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 java.lang.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 ${project.organization.name}. All Rights Reserved.