<commit_before>/* Copyright 2013 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package au.id.aj.efbp.node;

import java.util.Collections;
import java.util.Set;

import org.openide.util.Lookup;
import org.openide.util.lookup.AbstractLookup;
import org.openide.util.lookup.InstanceContent;

import au.id.aj.efbp.util.Statistics;
import au.id.aj.efbp.util.StopWatch;

public class AbstractNode implements Node
{
    private final NodeId id;
    private final StopWatch stopwatch;
    private final InstanceContent ic;
    private final Lookup lookup;

    protected AbstractNode(final NodeId id, final Object... content)
    {
        this.id = id;
        this.stopwatch = new StopWatch();
        this.ic = Node.Utils.generateInstanceContent(content);
        this.lookup = new AbstractLookup(this.ic);
    }

    @Override
    public final NodeId id() {
        return this.id;
    }

    @Override
    public final Statistics reportStatistics() {
        return this.stopwatch.report();
    }

    @Override
    public final Lookup getLookup() {
        return this.lookup;
    }

    protected void addContent(final Object content)
    {
        this.ic.add(content);
    }

    protected void removeContent(final Object content)
    {
        this.ic.remove(content);
    }

    @Override
    public Set<Node> execute() {
        return Collections.emptySet();
    }

    @Override
    public Set<Node> execute(int max) {
        return execute();
    }
}<commit_msg>node: Reduce boilerplate required to implement AbstractNode<commit_after>/* Copyright 2013 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package au.id.aj.efbp.node;

import java.util.Set;

import org.openide.util.Lookup;
import org.openide.util.lookup.AbstractLookup;
import org.openide.util.lookup.InstanceContent;

import au.id.aj.efbp.util.Statistics;
import au.id.aj.efbp.util.StopWatch;

public abstract class AbstractNode implements Node
{
    private final NodeId id;
    private final StopWatch stopwatch;
    private final InstanceContent ic;
    private final Lookup lookup;

    protected AbstractNode(final NodeId id, final Object... content)
    {
        this.id = id;
        this.stopwatch = new StopWatch();
        this.ic = Node.Utils.generateInstanceContent(content);
        this.lookup = new AbstractLookup(this.ic);
    }

    @Override
    public final NodeId id() {
        return this.id;
    }

    @Override
    public final Statistics reportStatistics() {
        return this.stopwatch.report();
    }

    @Override
    public final Lookup getLookup() {
        return this.lookup;
    }

    protected void addContent(final Object content)
    {
        this.ic.add(content);
    }

    protected void removeContent(final Object content)
    {
        this.ic.remove(content);
    }

    @Override
    public Set<Node> execute() {
        throw new UnsupportedOperationException("Unimplemented");
    }

    @Override
    public Set<Node> execute(int max) {
        throw new UnsupportedOperationException("Unimplemented");
    }
}
{'fraction_non_alphanumeric': 0.08852378616969102, 'fraction_numerical': 0.00392349190779794, 'mean_word_length': 3.002944062806673, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2645808', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1101, 'n_words': 371}