


/*
 * GemDesignNullaryStore.java
 * Creation date: Nov 22, 2004.
 * By: Edward Lam
 */
package org.openquark.cal.services;

import java.util.List;
import java.util.Set;

import org.openquark.cal.compiler.ModuleName;



/**
 * A design store for the nullary workspace, using files and folders in the file system.
 * @author Edward Lam
 */
class GemDesignNullaryStore extends ResourceNullaryStore.Module implements GemDesignStore {

    /**
     * Constructor for a GemDesignNullaryStore.
     */
    public GemDesignNullaryStore() {
        super(WorkspaceResource.GEM_DESIGN_RESOURCE_TYPE, GemDesignPathMapper.INSTANCE);
    }

    /**
     * {@inheritDoc}
     */
    public List<ResourceName> getModuleResourceNameList(ModuleName moduleName) {
        return GemDesignPathStoreHelper.getModuleResourceNameList(this, moduleName);
    }
    
    /**
     * {@inheritDoc}
     */
    public Set<ModuleName> getModuleNames() {
        return ModuleResourceStoreHelper.convertCollectionOfModuleNameStringsToSetOfModuleNames(
            NullaryEnvironment.getNullaryEnvironment().getFolderNamesWithFileExtension(getPathMapper().getBaseResourceFolder(), getPathMapper(), true));
    }

}
