Newer
Older
MagnetRON / src / org / ntlab / traceanalyzer / DictionaryServiceImpl.java
Aki Hongo on 3 Mar 2020 666 bytes first commit
package org.ntlab.traceanalyzer;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class DictionaryServiceImpl implements DictionaryService {

	private List fDictionaries = new ArrayList();
	
    public void registerDictionary(Dictionary dictionary) {
    	fDictionaries.add(dictionary);
    }
    
    public void unregisterDictionary(Dictionary dictionary) {
    	fDictionaries.remove(dictionary);
    }

	public boolean check(String word) {
		for (int i = 0; i < fDictionaries.size(); i++ ) {
			Dictionary dictionary = (Dictionary) fDictionaries.get(i);
			if(dictionary.check(word))
				return true;
		}
		return false;
	}

}