private Unit decodeUnit(boolean isLinear) { if (currentToken != CrsWktVariant.UNIT) { throw new WktDecodeException("Expected UNIT keyword, found " + currentToken.toString()); } String name = decodeName(); matchesElementSeparator(); double cf = decodeNumber(); matchesElementSeparator(); CrsId crsId = decodeOptionalAuthority(CrsId.UNDEFINED.getCode()); matchesCloseList(); return isLinear ? new LinearUnit(crsId, name, cf) : new AngularUnit(crsId, name, cf); }