edu.mit.jverbnet.data.syntax
Class SyntaxArgDesc.SyntaxArgDescBuilder

java.lang.Object
  extended by edu.mit.jverbnet.data.syntax.SyntaxArgDesc.SyntaxArgDescBuilder
All Implemented Interfaces:
ISyntaxArgDesc, ISyntaxArgDesc.ISyntaxArgDescBuilder
Enclosing class:
SyntaxArgDesc

public static class SyntaxArgDesc.SyntaxArgDescBuilder
extends java.lang.Object
implements ISyntaxArgDesc.ISyntaxArgDescBuilder

Default implementation of syntax arg descriptor builder interface.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.mit.jverbnet.data.syntax.ISyntaxArgDesc
ISyntaxArgDesc.ISyntaxArgDescBuilder
 
Constructor Summary
SyntaxArgDesc.SyntaxArgDescBuilder(SyntaxArgType type, java.lang.String value, INounPhraseType npType, ISelRestrictions<? extends IRestrType> selRestrs)
          Creates a new builder with the specified values.
 
Method Summary
 ISyntaxArgDesc create(ISyntaxDesc parent)
          Creates a syntax arg descriptor from the information contained in the builder.
 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.
 void setNounPhrasetype(INounPhraseType npType)
          Sets the noun phrase type of the argument.
 void setSelRestrictions(ISelRestrictions<? extends IRestrType> restrs)
          Sets the selectional restrictions for this argument
 void setType(SyntaxArgType type)
          Sets the type of the syntactic argument.
 void setValue(java.lang.String value)
          Sets 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.SyntaxArgDescBuilder

public SyntaxArgDesc.SyntaxArgDescBuilder(SyntaxArgType type,
                                          java.lang.String value,
                                          INounPhraseType npType,
                                          ISelRestrictions<? extends IRestrType> selRestrs)
Creates a new builder with the specified values. Any value may be set to null on construction.

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

setType

public void setType(SyntaxArgType type)
Description copied from interface: ISyntaxArgDesc.ISyntaxArgDescBuilder
Sets the type of the syntactic argument.

Specified by:
setType in interface ISyntaxArgDesc.ISyntaxArgDescBuilder
Parameters:
type - the type of the syntactic argument

setValue

public void setValue(java.lang.String value)
Description copied from interface: ISyntaxArgDesc.ISyntaxArgDescBuilder
Sets the value of the syntactic argument

Specified by:
setValue in interface ISyntaxArgDesc.ISyntaxArgDescBuilder
Parameters:
value - the value of the syntactic argument

setNounPhrasetype

public void setNounPhrasetype(INounPhraseType npType)
Description copied from interface: ISyntaxArgDesc.ISyntaxArgDescBuilder
Sets the noun phrase type of the argument. If non-null, this argument also sets the type to SyntaxArgType.NP.

Specified by:
setNounPhrasetype in interface ISyntaxArgDesc.ISyntaxArgDescBuilder
Parameters:
npType - the noun phrase type of the argument

setSelRestrictions

public void setSelRestrictions(ISelRestrictions<? extends IRestrType> restrs)
Description copied from interface: ISyntaxArgDesc.ISyntaxArgDescBuilder
Sets the selectional restrictions for this argument

Specified by:
setSelRestrictions in interface ISyntaxArgDesc.ISyntaxArgDescBuilder
Parameters:
restrs - the selectional restrictions for this argument

create

public ISyntaxArgDesc create(ISyntaxDesc parent)
Description copied from interface: ISyntaxArgDesc.ISyntaxArgDescBuilder
Creates a syntax arg descriptor from the information contained in the builder. If the builder does not have enough information to construct a complete descriptor, it will thrown an exception.

Specified by:
create in interface ISyntaxArgDesc.ISyntaxArgDescBuilder
Parameters:
parent - the parent of the descriptor
Returns:
the new descriptor, if it can be created


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