All Downloads are FREE. Search and download functionalities are using the official Maven repository.

prerna.query.querystruct.joins.RelationSet Maven / Gradle / Ivy

The newest version!
package prerna.query.querystruct.joins;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

public class RelationSet extends LinkedHashSet {

	@Override
	public boolean add(IRelation e) {
		Iterator it = this.iterator();
		while(it.hasNext()) {
			IRelation values = it.next();
			if(values.equals(e)) {
				return false;
			}
		}
		return super.add(e);
	}
	
//	public static void main(String[] args) {
//		Set values = new RelationSet();
//		values.add(new BasicRelationship(new String[]{"a","b","c"}));
//		values.add(new BasicRelationship(new String[]{"a","b","c"}));
//		values.add(new BasicRelationship(new String[]{"a","b","c"}));
//
//		List valuesList = new ArrayList<>();
//		valuesList.add(new BasicRelationship(new String[]{"a", "b", "c"}));
//		values.addAll(valuesList);
//		
//		System.out.println(values);
//	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy