Methods Summary |
---|
public synchronized java.lang.Object | clone()
try {
CircularIdentityList list = (CircularIdentityList)super.clone();
if (property != null) {
list.property = (Property)property.clone();
Property last = list.property;
while (last.next != null && last.next != property) {
last.next = (Property)last.next.clone();
last = last.next;
}
last.next = list.property;
}
return list;
} catch (CloneNotSupportedException cnse) {
}
return null;
|
public synchronized java.lang.Object | get()Returns the value currently being referenced.
if (property == null) {
return null;
}
return property.value;
|
public synchronized java.lang.Object | get(java.lang.Object key)Returns the value for a specific key.
if (property == null) {
return null;
}
Property p = property;
do {
if (p.key == key) {
return p.value;
}
p = p.next;
} while (p != property && p != null);
return null;
|
public synchronized java.lang.Object | next()Advanced the list returning the next key. This will only return
null if the list is empty.
if (property == null) {
return null;
}
if (property.next == null) {
return property.key;
}
property = property.next;
return property.key;
|
public synchronized void | set(java.lang.Object key, java.lang.Object value)Sets a particular value.
if (property == null) {
property = new Property(key, value, null);
}
else {
Property p = property;
Property last = p;
do {
if (p.key == key) {
p.value = value;
property = p;
return;
}
last = p;
p = p.next;
} while (p != property && p != null);
// not defined
if (value != null) {
if (p == null) {
// Only one element
p = property;
}
property = new Property(key, value, p);
last.next = property;
}
}
|