Top Description Fields Constructors Methods
org.jabref.logic.formatter.casechanger

public final Class Word

extends Object
Class Inheritance
Imports
java.util.Arrays, .HashSet, .Locale, .Objects, .Set, java.util.stream.Collectors

Represents a word in a title of a bibtex entry.

A word can have protected chars (enclosed in '{' '}') and may be a small (a, an, the, ...) word.

Field Summary

Modifier and TypeField and Description
private final char[]
public static final Set<String>
public static final Set<Character>
private final boolean[]
public static final Set<String>
SMALLER_WORDS

Set containing common lowercase function words

Constructor Summary

AccessConstructor and Description
public
Word(char[] chars, boolean[] protectedChars)

Method Summary

Modifier and TypeMethod and Description
public boolean
private boolean
isConjunction(char[] chars, int i)

public boolean
public static boolean
isSmallerWord(String word)

Case-insensitive check against Word#SMALLER_WORDS.

public boolean
public void
public void
toLowerCase()

Only change letters of the word that are unprotected to lower case.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
toUpperCase()

Only change letters of the word that are unprotected to upper case.

public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

charsback to summary
private final char[] chars
CONJUNCTIONSback to summary
public static final Set<String> CONJUNCTIONS
DASHESback to summary
public static final Set<Character> DASHES
protectedCharsback to summary
private final boolean[] protectedChars
SMALLER_WORDSback to summary
public static final Set<String> SMALLER_WORDS

Set containing common lowercase function words

Constructor Detail

Wordback to summary
public Word(char[] chars, boolean[] protectedChars)

Method Detail

endsWithColonback to summary
public boolean endsWithColon()
isConjunctionback to summary
private boolean isConjunction(char[] chars, int i)
isLargerWordback to summary
public boolean isLargerWord()
isSmallerWordback to summary
public static boolean isSmallerWord(String word)

Case-insensitive check against Word#SMALLER_WORDS. Checks for common function words.

isSmallerWordback to summary
public boolean isSmallerWord()
stripConsonantsback to summary
public void stripConsonants()
toLowerCaseback to summary
public void toLowerCase()

Only change letters of the word that are unprotected to lower case.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
toUpperCaseback to summary
public void toUpperCase()

Only change letters of the word that are unprotected to upper case.

toUpperFirstback to summary
public void toUpperFirst()
toUpperFirstIgnoreHyphenback to summary
public void toUpperFirstIgnoreHyphen()
toUpperFirstTitleback to summary
public void toUpperFirstTitle()