Class AbstractOperator

java.lang.Object
org.dspace.content.logic.operator.AbstractOperator
All Implemented Interfaces:
LogicalStatement
Direct Known Subclasses:
And, Nand, Nor, Or

public abstract class AbstractOperator extends Object implements LogicalStatement
Abstract class for an operator. An operator contains a list of logical statements (conditions or more operators) and depending on the kind of operator (AND, OR, NOT, etc.) the results of some or all sub-statements are evaluated and returned as a logical result
Author:
Kim Shepherd
  • Constructor Details

    • AbstractOperator

      public AbstractOperator()
      Default constructor
    • AbstractOperator

      public AbstractOperator(List<LogicalStatement> statements)
      Constructor to create operator from some predefined statements
      Parameters:
      statements -
  • Method Details

    • getStatements

      public List<LogicalStatement> getStatements()
      Get sub-statements for this operator
      Returns:
      list of sub-statements
    • setStatements

      public void setStatements(List<LogicalStatement> statements)
      Set sub-statements for this operator, as defined in item-filters.xml
      Parameters:
      statements - list of logical statements
    • getResult

      public boolean getResult(Context context, Item item) throws LogicalStatementException
      Description copied from interface: LogicalStatement
      Get the result of logical evaluation for an item
      Specified by:
      getResult in interface LogicalStatement
      Parameters:
      context - DSpace context
      item - Item to evaluate
      Returns:
      boolean result of evaluation (of sub-statements)
      Throws:
      LogicalStatementException