Top Description Fields Constructors Methods
org.jabref.logic.journals

public Class JournalAbbreviationRepository

extends Object
Class Inheritance
Imports
java.nio.file.Path, java.util.Collection, .HashMap, .Map, .Objects, .Optional, .Set, .TreeSet, java.util.regex.Matcher, .Pattern, org.h2.mvstore.MVMap, org.h2.mvstore.MVStore

A repository for all journal abbreviations, including add and find methods.

Field Summary

Modifier and TypeField and Description
private final Map<String, Abbreviation>
private final TreeSet<Abbreviation>
private final Map<String, Abbreviation>
private final Map<String, Abbreviation>
pack-priv static final Pattern
private final Map<String, Abbreviation>

Constructor Summary

AccessConstructor and Description
public
JournalAbbreviationRepository(Path journalList)

Initializes the internal data based on the abbreviations found in the given MV file

public
JournalAbbreviationRepository()

Initializes the repository with demonstration data.

Method Summary

Modifier and TypeMethod and Description
public void
public void
public Optional<Abbreviation>
get(String
The journal name (either full name or abbreviated name).
input
)

Attempts to get the abbreviation of the journal given.

public Collection<Abbreviation>
public Collection<Abbreviation>
public Optional<String>
public Optional<String>
public Set<String>
public Optional<String>
public Optional<String>
public boolean
isAbbreviatedName(String journalName)

Returns true if the given journal name is in its abbreviated form (e.g. Phys.

public boolean
isKnownName(String journalName)

Returns true if the given journal name is contained in the list either in its full form (e.g., Physical Review Letters) or its abbreviated form (e.g., Phys.

private static boolean
isMatched(String name, Abbreviation abbreviation)

private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

abbreviationToAbbreviationObjectback to summary
private final Map<String, Abbreviation> abbreviationToAbbreviationObject
customAbbreviationsback to summary
private final TreeSet<Abbreviation> customAbbreviations
dotlessToAbbreviationObjectback to summary
private final Map<String, Abbreviation> dotlessToAbbreviationObject
fullToAbbreviationObjectback to summary
private final Map<String, Abbreviation> fullToAbbreviationObject
QUESTION_MARKback to summary
pack-priv static final Pattern QUESTION_MARK
shortestUniqueToAbbreviationObjectback to summary
private final Map<String, Abbreviation> shortestUniqueToAbbreviationObject

Constructor Detail

JournalAbbreviationRepositoryback to summary
public JournalAbbreviationRepository(Path journalList)

Initializes the internal data based on the abbreviations found in the given MV file

JournalAbbreviationRepositoryback to summary
public JournalAbbreviationRepository()

Initializes the repository with demonstration data. Used if no abbreviation file is found.

Method Detail

addCustomAbbreviationback to summary
public void addCustomAbbreviation(Abbreviation abbreviation)
addCustomAbbreviationsback to summary
public void addCustomAbbreviations(Collection<Abbreviation> abbreviationsToAdd)
getback to summary
public Optional<Abbreviation> get(String input)

Attempts to get the abbreviation of the journal given.

Parameters
input:String

The journal name (either full name or abbreviated name).

getAllLoadedback to summary
public Collection<Abbreviation> getAllLoaded()
getCustomAbbreviationsback to summary
public Collection<Abbreviation> getCustomAbbreviations()
getDefaultAbbreviationback to summary
public Optional<String> getDefaultAbbreviation(String text)
getDotlessback to summary
public Optional<String> getDotless(String text)
getFullNamesback to summary
public Set<String> getFullNames()
getNextAbbreviationback to summary
public Optional<String> getNextAbbreviation(String text)
getShortestUniqueAbbreviationback to summary
public Optional<String> getShortestUniqueAbbreviation(String text)
isAbbreviatedNameback to summary
public boolean isAbbreviatedName(String journalName)

Returns true if the given journal name is in its abbreviated form (e.g. Phys. Rev. Lett.). The test is strict, i.e., journals whose abbreviation is the same as the full name are not considered

isKnownNameback to summary
public boolean isKnownName(String journalName)

Returns true if the given journal name is contained in the list either in its full form (e.g., Physical Review Letters) or its abbreviated form (e.g., Phys. Rev. Lett.).

isMatchedback to summary
private static boolean isMatched(String name, Abbreviation abbreviation)
isMatchedAbbreviatedback to summary
private static boolean isMatchedAbbreviated(String name, Abbreviation abbreviation)