/** * Removes all events that do not satisfy <code>filter</code>. * @param filter The {@link Predicate} that specifies which * {@link TimedEvent}s will be retained. * @return This, as per the builder pattern. */ public Builder filterEvents(Predicate<? super TimedEvent> filter) { eventList.retainAll(Collections2.filter(eventList, filter)); return self(); }
/** * Removes all events that do not satisfy <code>filter</code>. * @param filter The {@link Predicate} that specifies which * {@link TimedEvent}s will be retained. * @return This, as per the builder pattern. */ public Builder filterEvents(Predicate<? super TimedEvent> filter) { eventList.retainAll(Collections2.filter(eventList, filter)); return self(); }
/** * Removes all previously added model builders that are an instance of the * specified type. * @param type All model builders that are instance of this type are * removed. * @param <T> The type. * @return This, as per the builder pattern. */ public <T extends ModelBuilder<?, ?>> Builder removeModelsOfType( Class<T> type) { final List<ModelBuilder<?, ?>> toRemove = new ArrayList<>(); for (final ModelBuilder<?, ?> mb : modelBuilders) { if (type.isInstance(mb)) { toRemove.add(mb); } } modelBuilders.removeAll(toRemove); return self(); }
.iterator().next())); return self();
.iterator().next())); return self();
/** * Removes all previously added model builders that are an instance of the * specified type. * @param type All model builders that are instance of this type are * removed. * @param <T> The type. * @return This, as per the builder pattern. */ public <T extends ModelBuilder<?, ?>> Builder removeModelsOfType( Class<T> type) { final List<ModelBuilder<?, ?>> toRemove = new ArrayList<>(); for (final ModelBuilder<?, ?> mb : modelBuilders) { if (type.isInstance(mb)) { toRemove.add(mb); } } modelBuilders.removeAll(toRemove); return self(); }
/** * Adds the model builders. The builders will be used to instantiate * {@link Model}s needed for the scenario. * @param builders The model builders to add. * @return This, as per the builder pattern. */ public Builder addModels(Iterable<? extends ModelBuilder<?, ?>> builders) { Iterables.addAll(modelBuilders, builders); return self(); }
/** * The {@link ProblemClass} to use for the next scenario that is created. * @param pc The problem class to use. * @return This, as per the builder pattern. */ public Builder problemClass(ProblemClass pc) { problemClass = pc; return self(); }
/** * Add the specified {@link TimedEvent}s to the builder. * @param events The events to add. * @return This, as per the builder pattern. */ public Builder addEvents(Iterable<? extends TimedEvent> events) { for (final TimedEvent te : events) { addEvent(te); } return self(); }
/** * Adds the model builder. The builders will be used to instantiate * {@link Model}s needed for the scenario. * @param modelBuilder The model builder to add. * @return This, as per the builder pattern. */ public Builder addModel(ModelBuilder<?, ?> modelBuilder) { modelBuilders.add(modelBuilder); return self(); }
/** * Removes all events. * @return This, as per the builder pattern. */ public Builder clearEvents() { eventList.clear(); return self(); }
/** * Adds the model builder. The builders will be used to instantiate * {@link Model}s needed for the scenario. * @param modelBuilder The model builder to add. * @return This, as per the builder pattern. */ public Builder addModel(ModelBuilder<?, ?> modelBuilder) { modelBuilders.add(modelBuilder); return self(); }
/** * Add the specified {@link TimedEvent} to the builder. * @param event The event to add. * @return This, as per the builder pattern. */ public Builder addEvent(TimedEvent event) { eventList.add(event); return self(); }
/** * Removes all events. * @return This, as per the builder pattern. */ public Builder clearEvents() { eventList.clear(); return self(); }
/** * Adds the model builders. The builders will be used to instantiate * {@link Model}s needed for the scenario. * @param builders The model builders to add. * @return This, as per the builder pattern. */ public Builder addModels(Iterable<? extends ModelBuilder<?, ?>> builders) { Iterables.addAll(modelBuilders, builders); return self(); }
/** * Add the specified {@link TimedEvent} to the builder. * @param event The event to add. * @return This, as per the builder pattern. */ public Builder addEvent(TimedEvent event) { eventList.add(event); return self(); }
/** * The instance id to use for the next scenario that is created. * @param id The id to use. * @return This, as per the builder pattern. */ public Builder instanceId(String id) { instanceId = id; return self(); }
/** * The {@link ProblemClass} to use for the next scenario that is created. * @param pc The problem class to use. * @return This, as per the builder pattern. */ public Builder problemClass(ProblemClass pc) { problemClass = pc; return self(); }
/** * The instance id to use for the next scenario that is created. * @param id The id to use. * @return This, as per the builder pattern. */ public Builder instanceId(String id) { instanceId = id; return self(); }
/** * Add the specified {@link TimedEvent}s to the builder. * @param events The events to add. * @return This, as per the builder pattern. */ public Builder addEvents(Iterable<? extends TimedEvent> events) { for (final TimedEvent te : events) { addEvent(te); } return self(); }