ruper2/src/java/core/org/krysalis/ruper/repository/select NetworkRepositorySelector.java,NONE,1.1

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/repository/select
In directory sc8-pr-cvs1:/tmp/cvs-serv1200/src/java/core/org/krysalis/ruper/repository/select

Added Files:
	NetworkRepositorySelector.java 
Log Message:
RepositoryManager handles the repository selectors and comparators

--- NEW FILE: NetworkRepositorySelector.java ---
/*
 * Created on Sep 10, 2003
 */
package org.krysalis.ruper.repository.select;

import org.krysalis.ruper.repository.Repository;
import org.krysalis.ruper.repository.RepositoryAttribute;
import org.krysalis.ruper.util.select.Selector;

/**
 * @author anou_mana
 */
public class NetworkRepositorySelector implements Selector {

	RepositoryAttribute m_attribute;
	Object m_attributeValue;
	
	public NetworkRepositorySelector(RepositoryAttribute attribute, 
									Object attributeValue) {
		this.m_attribute = attribute;
		this.m_attributeValue = attributeValue;
	}

	public boolean select(Object repository) {
		boolean selected = false;

		Object attributeValue = ((Repository) repository).getAttributes().get(m_attribute);

		if (null != attributeValue) {
			selected = m_attributeValue.equals(attributeValue);
		}

		return selected;
	}
}




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.