private void printAuthors(StringBuffer buf){ String authors = getAuthors(); if ( authors == null) return; if ( authors.equals("")){ return; } printMultiLine(buf, "AUTHOR ", authors,','); }
/** * Parses the following record: * <pre> * COLUMNS DATA TYPE FIELD DEFINITION * ------------------------------------------------------------------------------------ * 1 - 6 Record name "AUTHOR" * 9 - 10 Continuation continuation Allows concatenation of multiple records. * 11 - 79 List authorList List of the author names, separated * by commas. * * </pre> * @param line */ private void pdb_AUTHOR_Handler(String line) { String authors = line.substring(10).trim(); String auth = pdbHeader.getAuthors(); if (auth == null){ pdbHeader.setAuthors(authors); } else { auth += authors; pdbHeader.setAuthors(auth); } }
@Override public void newAuditAuthor(AuditAuthor aa){ String name = aa.getName(); StringBuffer famName = new StringBuffer(); StringBuffer initials = new StringBuffer(); boolean afterComma = false; for ( char c: name.toCharArray()) { if ( c == ' ') continue; if ( c == ','){ afterComma = true; continue; } if ( afterComma) initials.append(c); else famName.append(c); } StringBuffer newaa = new StringBuffer(); newaa.append(initials); newaa.append(famName); PDBHeader header = structure.getPDBHeader(); String auth = header.getAuthors(); if (auth == null) { header.setAuthors(newaa.toString()); }else { auth += "," + newaa.toString(); header.setAuthors(auth); } }