/** * @param rec * @return Field */ public static MarcField getAuthorityMainHeading(MarcRecord rec) { for (Object o : rec.getFields()) { MarcField fld = (MarcField) o; if (fld.getTag() >= 200 && fld.getTag() < 300) { return fld; } } return null; }
/** * @param rec * @return int */ public static int findAuthorityType(MarcRecord rec) { MarcField mainHeading = getAuthorityMainHeading(rec); if (mainHeading == null) return AT_UNKNOWN; int tag200 = mainHeading.getTag(); // String sistema=MarcUtil.getSingleFieldValue("152",'b',rec); if (tag200 == 200 || tag200 == 210 || tag200 == 220) { String scx = mainHeading.getSingleSubfieldValue('x'); return scx == null ? AT_AUTHOR : AT_SUBJECT; } else return AT_SUBJECT; }