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.
Author:
Kim Shepherd
  • Constructor Details

    • 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 Details

    • 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:
      getResult in interface LogicalStatement
      Parameters:
      context - DSpace context
      item - Item to evaluate
      Returns:
      boolean result of NOT
      Throws:
      LogicalStatementException