@Override
  public MultipleObjectsBundle filter(MultipleObjectsBundle objects) {
    if(objects.dataLength() == 0) {
      return objects;
    }
    MultipleObjectsBundle bundle = new MultipleObjectsBundle();

    final Logging logger = getLogger();
    for(int r = 0; r < objects.metaLength(); r++) {
      @SuppressWarnings("unchecked")
      SimpleTypeInformation<Object> type = (SimpleTypeInformation<Object>) objects.meta(r);
      @SuppressWarnings("unchecked")
      final List<Object> column = (List<Object>) objects.getColumn(r);
      if(!getInputTypeRestriction().isAssignableFromType(type)) {
        bundle.appendColumn(type, column);
        continue;
      }
      // Get the replacement type information
      @SuppressWarnings("unchecked")
      final SimpleTypeInformation<I> castType = (SimpleTypeInformation<I>) type;

      // When necessary, perform an initialization scan
      if(prepareStart(castType)) {
        FiniteProgress pprog = logger.isVerbose() ? new FiniteProgress("Preparing normalization", objects.dataLength(), logger) : null;
        for(Object o : column) {
          @SuppressWarnings("unchecked")
          final I obj = (I) o;
          prepareProcessInstance(obj);
          logger.incrementProcessed(pprog);
        }
        logger.ensureCompleted(pprog);
        prepareComplete();
      }

      @SuppressWarnings("unchecked")
      final List<O> castColumn = (List<O>) column;
      bundle.appendColumn(convertedType(castType), castColumn);

      // Normalization scan
      FiniteProgress nprog = logger.isVerbose() ? new FiniteProgress("Data normalization", objects.dataLength(), logger) : null;
      for(int i = 0; i < objects.dataLength(); i++) {
        @SuppressWarnings("unchecked")
        final I obj = (I) column.get(i);
        final O normalizedObj = filterSingleObject(obj);
        castColumn.set(i, normalizedObj);
        logger.incrementProcessed(nprog);
      }
      logger.ensureCompleted(nprog);
    }
    return bundle;
  }
@ Override public MultipleObjectsBundle filter ( MultipleObjectsBundle objects ) { if ( objects . dataLength ( ) == 0 ) { return objects ; } MultipleObjectsBundle bundle = new MultipleObjectsBundle ( ) ; final Logging logger = getLogger ( ) ; for ( int r = 0 ; r < objects . metaLength ( ) ; r ++ ) { @ SuppressWarnings ( "unchecked" ) SimpleTypeInformation < Object > type = ( SimpleTypeInformation < Object > ) objects . meta ( r ) ; @ SuppressWarnings ( "unchecked" ) final List < Object > column = ( List < Object > ) objects . getColumn ( r ) ; if ( ! getInputTypeRestriction ( ) . isAssignableFromType ( type ) ) { bundle . appendColumn ( type , column ) ; continue ; } @ SuppressWarnings ( "unchecked" ) final SimpleTypeInformation < I > castType = ( SimpleTypeInformation < I > ) type ; if ( prepareStart ( castType ) ) { FiniteProgress pprog = logger . isVerbose ( ) ? new FiniteProgress ( "Preparing normalization" , objects . dataLength ( ) , logger ) : null ; for ( Object o : column ) { @ SuppressWarnings ( "unchecked" ) final I obj = ( I ) o ; prepareProcessInstance ( obj ) ; logger . incrementProcessed ( pprog ) ; } logger . ensureCompleted ( pprog ) ; prepareComplete ( ) ; } @ SuppressWarnings ( "unchecked" ) final List < O > castColumn = ( List < O > ) column ; bundle . appendColumn ( convertedType ( castType ) , castColumn ) ; FiniteProgress nprog = logger . isVerbose ( ) ? new FiniteProgress ( "Data normalization" , objects . dataLength ( ) , logger ) : null ; for ( int i = 0 ; i < objects . dataLength ( ) ; i ++ ) { @ SuppressWarnings ( "unchecked" ) final I obj = ( I ) column . get ( i ) ; final O normalizedObj = filterSingleObject ( obj ) ; castColumn . set ( i , normalizedObj ) ; logger . incrementProcessed ( nprog ) ; } logger . ensureCompleted ( nprog ) ; } return bundle ; }
A standard implementation of the filter process. First of all, all suitable
representations are found. Then (if {@link #prepareStart} returns true),
the data is processed read-only in a first pass.

In the main pass, each object is then filtered using
{@link #filterSingleObject}.

@param objects Objects to filter
@return Filtered bundle