1 package org.myoodb.collectable; 25 26 public class HashSetDbImpl extends CollectableDbImpl implements HashSet 27 { 28 private java.util.HashSet m_hashSet; 29 30 public HashSetDbImpl() 31 { 32 m_hashSet = new java.util.HashSet (); 33 } 34 35 public void fixUpReference(long fixUpTime) 36 { 37 if (referenceHasBeenFixedUp(fixUpTime) == true) 38 { 39 return; 40 } 41 42 super.fixUpReference(fixUpTime); 43 44 synchronized(m_hashSet) 45 { 46 CollectableDbImpl.fixUpReference(m_hashSet, fixUpTime); 47 } 48 } 49 50 public boolean add(Object o) 51 { 52 boolean retval = false; 53 54 synchronized(m_hashSet) 55 { 56 retval = m_hashSet.add(o); 57 } 58 59 return retval; 60 } 61 62 public boolean addAll(java.util.Collection c) 63 { 64 boolean retval = false; 65 66 synchronized(m_hashSet) 67 { 68 retval = m_hashSet.addAll(c); 69 } 70 71 return retval; 72 } 73 74 public boolean contains(Object o) 75 { 76 boolean retval = false; 77 78 synchronized(m_hashSet) 79 { 80 retval = m_hashSet.contains(o); 81 } 82 83 return retval; 84 } 85 86 public boolean remove(Object o) 87 { 88 boolean retval = false; 89 90 synchronized(m_hashSet) 91 { 92 retval = m_hashSet.remove(o); 93 } 94 95 return retval; 96 } 97 98 public boolean removeAll(java.util.Collection c) 99 { 100 boolean retval = false; 101 102 synchronized(m_hashSet) 103 { 104 retval = m_hashSet.removeAll(c); 105 } 106 107 return retval; 108 } 109 110 public void clear() 111 { 112 synchronized(m_hashSet) 113 { 114 m_hashSet.clear(); 115 } 116 } 117 public int size() 118 { 119 int retval = -1; 120 121 synchronized(m_hashSet) 122 { 123 retval = m_hashSet.size(); 124 } 125 126 return retval; 127 } 128 129 public String toString() 130 { 131 String retval = null; 132 133 synchronized(m_hashSet) 134 { 135 retval = m_hashSet.toString(); 136 } 137 138 return retval; 139 } 140 141 public boolean equals(Object obj) 142 { 143 boolean retval = false; 144 145 synchronized(m_hashSet) 146 { 147 retval = m_hashSet.equals(obj); 148 } 149 150 return retval; 151 } 152 153 public java.util.HashSet collection() 154 { 155 return m_hashSet; 156 } 157 158 public java.util.ArrayList toArrayList() 159 { 160 java.util.ArrayList retval = null; 161 162 synchronized(m_hashSet) 163 { 164 retval = new java.util.ArrayList (m_hashSet); 165 } 166 167 return retval; 168 } 169 170 public Iterator iterator() 171 { 172 return (Iterator) getDatabase().createObject(IteratorDbImpl.class.getName(), "java.util.Collection", new Object [] {m_hashSet}); 173 } 174 } 175
| Popular Tags
|