added method for comparing distribution nodes for the distributiontree.java class
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / description / Distribution.java
index 98afb5a19c652253f5c3fbe87f78e58f89cdfde1..e3f479f99dd8a8ae2936c771fc404900dc875207 100644 (file)
@@ -150,5 +150,22 @@ public class Distribution extends DescriptionElementBase {
        public void setStatus(PresenceAbsenceTermBase<?> status){
                this.status = status;
        }
+       
+       public boolean equalsForTree(Distribution dist){
+               boolean result = false;
+               if (this.getArea().getLabel().compareTo(dist.getArea().getLabel()) == 0 &&
+                               this.getArea().getLevel().getLabel().compareTo(dist.getArea().getLevel().getLabel()) == 0){
+                       result = true;
+               }
+               return result;
+       }
+       
+       public String toString(){
+               String result = "null";
+               if (this.area != null){                 
+                       result = area.getLabel().toString();
+               }
+               return result;
+       }
 
 }
\ No newline at end of file