Interface ICollectionFilter


  • public interface ICollectionFilter
    A collection filter is used by the CrossSection class to filter elements of the source collection.

    Imagine to have a list of agents of the class MyAgent, which contains a boolean variable isFemale and an int variable age.

    In order to obtain the list of ages of the males in the collection, the user can crate a class inheriting from ICollectionFilter

    During the cross section iteration of the list, the isFiltered method is passed the current object and the relative value is read only if the filter returns true.

    Title: JAS

    Description: Java Agent-based Simulation library

    Copyright (C) 2002 Michele Sonnessa

    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
    Author:
    Michele Sonnessa

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isFiltered​(java.lang.Object object)
      Return if the passed object must be considered by the CrossSection iterator.
    • Method Detail

      • isFiltered

        boolean isFiltered​(java.lang.Object object)
        Return if the passed object must be considered by the CrossSection iterator.
        Parameters:
        object - The current object in the CrossSection iteration of the source collection.
        Returns:
        True if object has the required status, false otherwise.