Bibi
19 Oct 2005 21:04

ujap.bibi
Class AuthorYearKey

java.lang.Object
  extended byujap.bibi.KeyGenerator
      extended byujap.bibi.AuthorYearKey

class AuthorYearKey
extends KeyGenerator

Generates keys in the form "Author_2003" for one author and "Author_et_al_2003" for more than one author. Expects authors to be a String in bibi format: "Lastname, F.M. and Author, V.I."

Author:
Ute Platzer

Nested Class Summary
 
Nested classes inherited from class ujap.bibi.KeyGenerator
 
Field Summary
 
Fields inherited from class ujap.bibi.KeyGenerator
GENERATE_ALL, GENERATE_NONE, GENERATE_ONLY_EMPTY, GENERATE_SELECTED
 
Constructor Summary
(package private) AuthorYearKey()
           
 
Method Summary
private  Set createKeySet(Collection entries)
          returns a set of Strings with all entry keys in the bibtex file
 void generateKey(Entry e, Collection allEntries)
          generate a key for a single Entry.
 void generateKeysForAll(Collection c)
          generate keys for all Entries in the Collection
 void generateKeysForEmpty(Collection c)
          generate keys for all Entries that do not have a key (null or empty String) yet.
private  void generateSingleKey(Entry e, Set keys)
          create and set a key for this entry and add it to the key set.
private  String parseAuthors(String authors)
          evaluate author string and return the first author.
 
Methods inherited from class ujap.bibi.KeyGenerator
getResources, showDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorYearKey

AuthorYearKey()
Method Detail

generateKeysForAll

public void generateKeysForAll(Collection c)
Description copied from class: KeyGenerator
generate keys for all Entries in the Collection

Specified by:
generateKeysForAll in class KeyGenerator

generateKeysForEmpty

public void generateKeysForEmpty(Collection c)
Description copied from class: KeyGenerator
generate keys for all Entries that do not have a key (null or empty String) yet.

Specified by:
generateKeysForEmpty in class KeyGenerator

createKeySet

private Set createKeySet(Collection entries)
returns a set of Strings with all entry keys in the bibtex file


generateKey

public void generateKey(Entry e,
                        Collection allEntries)
Description copied from class: KeyGenerator
generate a key for a single Entry.

Specified by:
generateKey in class KeyGenerator
Parameters:
e - the Entry for which to generate the key.
allEntries - a Collection of all entries; required because keys have to be unique and if the generator doesn't know all keys, it cannot be sure the newly generated one is unique.

generateSingleKey

private void generateSingleKey(Entry e,
                               Set keys)
create and set a key for this entry and add it to the key set.

Parameters:
e - the entry for which to determine a key
keys - the set containing all keys (strings) in the current bibtex file

parseAuthors

private String parseAuthors(String authors)
evaluate author string and return the first author. undefined results may occur if string is not in the form "Lastname, F.M. and Author, V.I." because this method looks for "and" as author name separator.
this method doesn't use a professional parser and cannot be used to verify that the author string is in a specific format.


Bibi
19 Oct 2005 21:04

Copyright ? 2002-2005 Ute Platzer. All Rights Reserved.