ani-lang / anilang-core

Core functionality of Ani language.
Other
1 stars 0 forks source link

move to interface #150

Open github-actions[bot] opened 1 year ago

github-actions[bot] commented 1 year ago

144

https://github.com/ani-lang/anilang-core/blob/454695ea22d89ffeb43149414a7444541b17a08b/anilang-context/src/main/java/com/anilang/context/program/AniPaths.java#L12


/*
 * Property of ani-lang project.
 */

package com.anilang.context.program;

import java.nio.file.Path;
import java.util.HashSet;
import java.util.Set;

public final class AniPaths {
    // TODO move to interface
    // #144

    /**
     * Initial file. Imports others. Initial point.
     */
    private final Path base;
    /**
     * Involved files through import including the base path.
     */
    private final Set<Path> files;

    public AniPaths(final Path base) {
        this.base = base;
        files = new HashSet<>();
    }

    public void add(final Path path) {
        this.files.add(path);
    }

    public boolean contains(final Path path) {
        return this.files.contains(path);
    }

    public void reset() {
        this.files.clear();
    }
}