1 19 package org.openharmonise.vfs.metadata.value; 20 21 import java.util.*; 22 23 import org.openharmonise.vfs.metadata.*; 24 25 26 33 public class PropertyValue implements ValueInstance { 34 35 38 ArrayList m_aPropertyInstances = new ArrayList(); 39 40 public PropertyValue() { 41 super(); 42 } 43 44 49 public PropertyValue(ArrayList aPropertyInstances) { 50 super(); 51 this.m_aPropertyInstances = aPropertyInstances; 52 } 53 54 59 public void setValue(ArrayList aPropertyInstances) { 60 this.m_aPropertyInstances = aPropertyInstances; 61 } 62 63 69 public ArrayList getValue() { 70 return this.m_aPropertyInstances; 71 } 72 73 76 public boolean equals(Object arg0) { 77 if(super.equals(arg0)) { 78 return true; 79 } else if(arg0 instanceof PropertyValue) { 80 if( this.compareAllValues( ((PropertyValue)arg0).getValue()) ) { 81 return true; 82 } else { 83 return false; 84 } 85 } else { 86 return false; 87 } 88 } 89 90 97 private boolean compareAllValues(ArrayList aPropertyInstances) { 98 boolean bSame = true; 99 100 Iterator itor = aPropertyInstances.iterator(); 101 while (itor.hasNext()) { 102 boolean bFound = false; 103 PropertyInstance propInst = (PropertyInstance) itor.next(); 104 Iterator itor2 = this.m_aPropertyInstances.iterator(); 105 while (itor2.hasNext()) { 106 PropertyInstance myPropInst = (PropertyInstance) itor2.next(); 107 if(myPropInst.equals(propInst)) { 108 bFound = true; 109 break; 110 } 111 } 112 if(!bFound) { 113 bSame=false; 114 break; 115 } 116 } 117 118 return bSame; 119 } 120 121 } 122 | Popular Tags |