devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

package tests;

import java.util.Map;
import java.util.Iterator;

import org.stringtree.factory.memory.MapTractRepository;
import org.stringtree.util.tract.Tract;

import com.efsol.friki.*;

public class InMemoryRepository 
	extends MapTractRepository
	implements RepositoryDriver
{
	public InMemoryRepository(Map map)
	{
		super(map);
	}

	public InMemoryRepository()
	{
		super();
	}

	public boolean isWritable(String name)
	{
		return true;
	}

	public boolean isReadable(String name)
	{
		return true;
	}

	public Tract get(String name)
	{
		return (Page)map.get(name);
	}

	public void put(String name, Tract page)
	{
		map.put(name, page);
	}

	public String backup(String name)
	{
		return name;
	}

	public boolean contains(String name)
	{
		return map.containsKey(name);
	}

	public Iterator allPageNames()
	{
		return map.keySet().iterator();
	}
	
	public String escape(String name)
	{
		return name;
	}
	
	public String unescape(String name)
	{
		return name;
	}
}




Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
 
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com