}
private void parsePart(String part) {
int spaceIndex = part.indexOf(' ');
if (spaceIndex==-1) {
throw new PvmException("couldn't parse duration part "+part);
}
String quantityText = part.substring(0, spaceIndex).trim();
spaceIndex = part.lastIndexOf(' ');
String unitText = part.substring(spaceIndex+1).trim().toLowerCase();
int quantity;
try {
quantity = Integer.parseInt(quantityText);
} catch (NumberFormatException e) {
throw new PvmException("couldn't parse quantity "+quantityText+" in duration text", e);
}
FieldSetter fieldSetter = fieldSetters.get(unitText);
if (fieldSetter==null) {
throw new PvmException("couldn't parse quantity "+quantityText);
}
fieldSetter.set(this, quantity);
}