Class Not
- java.lang.Object
-
- org.dspace.content.logic.operator.Not
-
- All Implemented Interfaces:
LogicalStatement
public class Not extends Object implements LogicalStatement
An operator that implements NOT by simply negating a statement Note that this operator doesn't actually implement the 'AbstractOperator' interface because we only want one sub-statement. So it's actually just a simple implementation of LogicalStatement. Not can have one sub-statement only, while and, or, nor, ... can have multiple sub-statements.- Version:
- $Revision$
- Author:
- Kim Shepherd
-
-
Constructor Summary
Constructors Constructor Description Not()Default constructorNot(LogicalStatement statement)Constructor that accepts predefined list of statements as defined in item-filters.xml
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetResult(Context context, Item item)Return true if the result of the sub-statement is false Return false otherwiseLogicalStatementgetStatements()Get sub-statement (note: singular! even though we keep the method name) for this operatorvoidsetStatements(LogicalStatement statement)Set sub-statement (note: singular!) for this operator, as defined in item-filters.xml
-
-
-
Constructor Detail
-
Not
public Not()
Default constructor
-
Not
public Not(LogicalStatement statement)
Constructor that accepts predefined list of statements as defined in item-filters.xml- Parameters:
statement- Single logical statement
-
-
Method Detail
-
getStatements
public LogicalStatement getStatements()
Get sub-statement (note: singular! even though we keep the method name) for this operator- Returns:
- list of sub-statements
-
setStatements
public void setStatements(LogicalStatement statement)
Set sub-statement (note: singular!) for this operator, as defined in item-filters.xml- Parameters:
statement- a single statement to apply to NOT operation
-
getResult
public boolean getResult(Context context, Item item) throws LogicalStatementException
Return true if the result of the sub-statement is false Return false otherwise- Specified by:
getResultin interfaceLogicalStatement- Parameters:
context- DSpace contextitem- Item to evaluate- Returns:
- boolean result of NOT
- Throws:
LogicalStatementException
-
-