buff.append("/");
final BigDecimal resolution = dimension.getResolution();
if (resolution != null) {
// resolution has been provided
buff.append(new DefaultPeriodDuration(resolution.longValue()).toString());
} else {
if (values.size() >= 2 && allDates(values)) {
int count = 2, i = 2;
Date[] timePositions = new Date[count];
for (Object date : values) {
timePositions[count - i--] = (Date) date;
if (i == 0)
break;
}
long durationInMilliSeconds = timePositions[count - 1].getTime()
- timePositions[count - 2].getTime();
buff.append(new DefaultPeriodDuration(durationInMilliSeconds).toString());
} else {
// assume 1 second and be done with it...
buff.append("PT1S");
}
}