Value[] lengths = new Value[values.length];
for (int i = 0; i < lengths.length; i++) {
long len;
int type = values[i].getType();
if (type == PropertyType.NAME) {
len = vf.createValue(qvf.create(values[i].getName())).getString().length();
} else if (type == PropertyType.PATH) {
len = vf.createValue(qvf.create(values[i].getPath())).getString().length();
} else {
len = Util.getLength(values[i]);
}