}
for (Property property : properties)
{
Object value = property.getValue();
Path itemPath = property.getPath();
List<Object> values = lists.get(itemPath);
if (values == null)
{
values = new ArrayList<Object>(4);
lists.put(itemPath, values);
}
// need to pad the list with nulls if any values are missing
while (values.size() < count)
{
values.add(null);
}
values.add(value);
}
}
else
{
Collection<List<Object>> values = lists.values();
for (List<Object> value : values)
{
value.add(null);
}
}
count++;
}
// optimise for case of single properties
if (lists.size() == 1)
{
Path childPath = lists.keySet().iterator().next();
List<?> values = lists.get(childPath);
return new SinglePropertySet(childPath, values, indexed);
}
else
{