package org.obda.query.domain.imp;

import java.net.URI;

import org.obda.query.domain.Predicate;

public class PredicateImp implements Predicate{

	private int arity = -1;
	private URI name = null;
	private int identfier = -1;

	//TODO PredicateImp remove identifier
	protected PredicateImp (URI name, int identifier, int arity){
		this.name = name;
		this.identfier = name.toString().hashCode();
		this.arity = arity;
	}

	public int getArity() {
		return arity;
	}

	public URI getName() {
		return name;
	}

	public void setName(URI name) {
		this.name = name;
	}

	@Override
	public boolean equals(Object obj){

		if(obj == null|| !(obj instanceof PredicateImp)){
			return false;
		}else{
			PredicateImp pred2 =(PredicateImp)obj;
			if (pred2.arity != arity)
				return false;
			return this.identfier == pred2.identfier;
		}
	}

	@Override
	public int hashCode(){
		return identfier;
	}

	public Predicate copy() {
		return new PredicateImp(this.name, this.identfier, this.arity);
	}
	
	public String toString() {
		return this.name.toString();
	}
}

@@ -238,48 +238,8 @@
 %0D%0A%0D%0A
-%09//TODO PredicateImp remove identifier%0D%0A
 %09pro
@@ -272,24 +272,8 @@
 ame,
- int identifier,
  int
@@ -372,32 +372,105 @@
 = arity;%0D%0A%09%7D%0D%0A%0D%0A
+%09public void setName(URI name) %7B%0D%0A%09%09this.name = name;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A
 %09public int getA
@@ -494,32 +494,44 @@
 n arity;%0D%0A%09%7D%0D%0A%0D%0A
+%09@Override%0D%0A
 %09public URI getN
@@ -565,69 +565,8 @@
 %0D%0A%0D%0A
-%09public void setName(URI name) %7B%0D%0A%09%09this.name = name;%0D%0A%09%7D%0D%0A%0D%0A
 %09@Ov
@@ -607,16 +607,17 @@
 ect obj)
+ 
 %7B%0D%0A%0D%0A%09%09i
@@ -617,16 +617,17 @@
 %0D%0A%0D%0A%09%09if
+ 
 (obj == 
@@ -664,17 +664,16 @@
 ateImp))
-%7B
 %0D%0A%09%09%09ret
@@ -688,19 +688,10 @@
 e;%0D%0A
-%09%09%7Delse%7B
 %0D%0A
-%09
 %09%09Pr
@@ -708,16 +708,17 @@
  pred2 =
+ 
 (Predica
@@ -727,16 +727,17 @@
 Imp)
+ 
 obj;%0D%0A%09%09
 %09if 
@@ -732,17 +732,16 @@
 obj;%0D%0A%09%09
-%09
 if (pred
@@ -762,17 +762,16 @@
 ty)%0D%0A%09%09%09
-%09
 return f
@@ -777,17 +777,18 @@
 false;%0D%0A
-%09
+%0D%0A
 %09%09return
@@ -828,13 +828,8 @@
 r;%0D%0A
-%09%09%7D%0D%0A
 %09%7D%0D%0A
@@ -886,32 +886,44 @@
 entfier;%0D%0A%09%7D%0D%0A%0D%0A
+%09@Override%0D%0A
 %09public Predicat
@@ -974,24 +974,8 @@
 ame,
- this.identfier,
  thi
@@ -989,17 +989,28 @@
 );%0D%0A%09%7D%0D%0A
-%09
+%0D%0A%09@Override
 %0D%0A%09publi
@@ -1041,25 +1041,25 @@
 %09return 
-this.n
+getN
 ame
+()
 .toStrin

Remove the identifier parameter in the object constructor.