diff options
Diffstat (limited to 'source/com/c2kernel/property/PropertyUtility.java')
| -rw-r--r-- | source/com/c2kernel/property/PropertyUtility.java | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/source/com/c2kernel/property/PropertyUtility.java b/source/com/c2kernel/property/PropertyUtility.java index 40d15bd..f8e714c 100644 --- a/source/com/c2kernel/property/PropertyUtility.java +++ b/source/com/c2kernel/property/PropertyUtility.java @@ -10,6 +10,7 @@ package com.c2kernel.property;
import java.util.ArrayList;
+import java.util.Iterator;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.persistency.outcome.Outcome;
@@ -21,36 +22,32 @@ import com.c2kernel.utils.Logger; public class PropertyUtility
{
- static public String getValue(ArrayList<?> pdlist, String name)
+ static public String getValue(ArrayList<PropertyDescription> pdlist, String name)
{
- Object[] values = pdlist.toArray();
- for (Object value : values) {
- PropertyDescription pd = (PropertyDescription) value;
+ for (PropertyDescription pd : pdlist) {
if ( name.equalsIgnoreCase(pd.getName()) )
return pd.getDefaultValue();
}
return null;
}
- static public String getNames(ArrayList<?> pdlist)
+ static public String getNames(ArrayList<PropertyDescription> pdlist)
{
- Object[] values = pdlist.toArray();
StringBuffer names = new StringBuffer();
- for (Object value : values)
- names.append( ((PropertyDescription)value).getDefaultValue()).append(" ");
+ for (PropertyDescription value : pdlist)
+ names.append( value.getDefaultValue()).append(" ");
return names.toString();
}
- static public String getClassIdNames(ArrayList<?> pdlist)
+ static public String getClassIdNames(ArrayList<PropertyDescription> pdlist)
{
- Object[] values = pdlist.toArray();
StringBuffer names = new StringBuffer();
- for (int i=0;i<values.length;i++)
- {
- PropertyDescription pd = ((PropertyDescription)values[i]);
+
+ for (Iterator<PropertyDescription> iter = pdlist.iterator(); iter.hasNext();) {
+ PropertyDescription pd = iter.next();
if (pd.getIsClassIdentifier())
names.append(pd.getName());
- if (i<values.length-1 && i!=0)
+ if (iter.hasNext())
names.append(",");
}
return names.toString();
|
