/** * Creates a new {@link AllocationEventFilter} instance through a {@link Builder}. * * @since 0.27 */ public static Builder newBuilder() { return new AllocationEventFilter(null).new Builder(); }
private AllocationReporter getAllocationReporter(LanguageInfo info) { AllocationReporter allocationReporter = new AllocationReporter(info); allocationReporters.add(allocationReporter); for (EventBinding.Allocation<? extends AllocationListener> binding : allocationBindings) { if (binding.getAllocationFilter().contains(info)) { allocationReporter.addListener(binding.getElement()); } } return allocationReporter; }
private AllocationReporter getAllocationReporter(LanguageInfo info) { AllocationReporter allocationReporter = new AllocationReporter(info); allocationReporters.add(allocationReporter); for (EventBinding.Allocation<? extends AllocationListener> binding : allocationBindings) { if (binding.getAllocationFilter().contains(info)) { allocationReporter.addListener(binding.getElement()); } } return allocationReporter; }
private <T extends AllocationListener> EventBinding<T> addAllocationBinding(EventBinding.Allocation<T> binding) { if (TRACE) { trace("BEGIN: Adding allocation binding %s%n", binding.getElement()); } this.allocationBindings.add(binding); for (AllocationReporter allocationReporter : allocationReporters) { if (binding.getAllocationFilter().contains(allocationReporter.language)) { allocationReporter.addListener(binding.getElement()); } } if (TRACE) { trace("END: Added allocation binding %s%n", binding.getElement()); } return binding; }
/** * Creates a new {@link AllocationEventFilter} instance through a {@link Builder}. * * @since 0.27 */ public static Builder newBuilder() { return new AllocationEventFilter(null).new Builder(); }
private <T extends AllocationListener> EventBinding<T> addAllocationBinding(EventBinding.Allocation<T> binding) { if (TRACE) { trace("BEGIN: Adding allocation binding %s%n", binding.getElement()); } this.allocationBindings.add(binding); for (AllocationReporter allocationReporter : allocationReporters) { if (binding.getAllocationFilter().contains(allocationReporter.language)) { allocationReporter.addListener(binding.getElement()); } } if (TRACE) { trace("END: Added allocation binding %s%n", binding.getElement()); } return binding; }
/** * Create an instance of {@link AllocationEventFilter} based on the current setup of this * builder. * * @since 0.27 */ public AllocationEventFilter build() { Set<LanguageInfo> langSet; if (langs == null) { langSet = null; } else if (langs.length == 1) { langSet = Collections.singleton(langs[0]); } else { langSet = new HashSet<>(); for (LanguageInfo li : langs) { langSet.add(li); } } return new AllocationEventFilter(langSet); } }
AllocationListener l = (AllocationListener) binding.getElement(); for (AllocationReporter allocationReporter : allocationReporters) { if (allocationBinding.getAllocationFilter().contains(allocationReporter.language)) { allocationReporter.removeListener(l);
/** * Create an instance of {@link AllocationEventFilter} based on the current setup of this * builder. * * @since 0.27 */ public AllocationEventFilter build() { Set<LanguageInfo> langSet; if (langs == null) { langSet = null; } else if (langs.length == 1) { langSet = Collections.singleton(langs[0]); } else { langSet = new HashSet<>(); for (LanguageInfo li : langs) { langSet.add(li); } } return new AllocationEventFilter(langSet); } }
AllocationListener l = (AllocationListener) binding.getElement(); for (AllocationReporter allocationReporter : allocationReporters) { if (allocationBinding.getAllocationFilter().contains(allocationReporter.language)) { allocationReporter.removeListener(l);