Class ModulusFilter

java.lang.Object
nl.tudelft.simulation.language.filters.AbstractFilter
nl.tudelft.simulation.language.filters.ModulusFilter
All Implemented Interfaces:
Serializable, FilterInterface

public class ModulusFilter extends AbstractFilter
The modulus filter only accepts the nth event where n % given modulus = 0.

Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.

Author:
Peter Jacobs
See Also:
  • Constructor Details

    • ModulusFilter

      public ModulusFilter(long modulus)
      constructs a new ModulusFilter.
      Parameters:
      modulus - long; the modulus to use
  • Method Details

    • filter

      protected boolean filter(Object entry)
      filters the entry. This method should be implemented by every filter based on its semantic meaning.
      Specified by:
      filter in class AbstractFilter
      Parameters:
      entry - Object; the entry to filter.
      Returns:
      whether to accept the value.
    • getCriterion

      public String getCriterion()
      returns a string representation of the criterion.
      Specified by:
      getCriterion in interface FilterInterface
      Specified by:
      getCriterion in class AbstractFilter
      Returns:
      the string representing the criterion