Verified Owner
Top Description Fields Constructors Methods
org.jabref.model.entry

public final Enum Month

extends Enum<Month>
Class Inheritance
Annotations
@AllowedToUseLogic:Uses StringUtil temporarily
Imports
java.util.Optional, org.jabref.architecture.AllowedToUseLogic, org.jabref.logic.bibtex.FieldWriter, org.jabref.logic.util.strings.StringUtil

Represents a Month of the Year.

Field Summary

Modifier and TypeField and Description
public static final Month
public static final Month
public static final Month
public static final Month
private final String
public static final Month
public static final Month
public static final Month
public static final Month
public static final Month
public static final Month
private final int
public static final Month
public static final Month
private final String
private final String

Constructor Summary

AccessConstructor and Description
private
Month(String fullName, String shortName, int number)

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

Month
getFullName
()

Returns the name of the long in unabbreviated English.

public String

Returns:

Month in JabRef format
getJabRefFormat
()

Returns the month in JabRef format.

public static Optional<Month>
getMonthByNumber(int
1-12 is valid
number
)

Find month by one-based number.

public static Optional<Month>
getMonthByShortName(String
"jan", "feb", ...
shortName
)

Find month by shortName (3 letters) case-insensitive.

public int

Returns:

number of the month in the Year
getNumber
()

Returns the number of the Month in a 1-indexed fashion: 1 -> January, 2 -> February etc.

public String

Returns:

3-letter identifier for a Month
getShortName
()

Returns the name of a Month in a short (3-letter) format.

public String

Returns:

number of the month in the Year with two digits
getTwoDigitNumber
()

Returns the number of the Month in a 1-indexed fashion using exactly two digits: 01 -> January, 02 -> February...

public static boolean

Returns:

true if the value matches the strict format criteria
isStrictFormat
(String
the string value to check
value
)

Checks if the value is in a strict BibTeX format.

public static Optional<Month>

Returns:

the corresponding Month instance
parse
(String
the given value
value
)

This method accepts three types of months:

  • Single and Double Digit months from 1 to 12 (01 to 12)
  • 3 Digit BibTeX strings (jan, feb, mar...) possibly with # prepended
  • Full English month identifiers.
pack-priv static Optional<Month>

Returns:

the corresponding month instance, empty if input is not in German form
parseGermanShortMonth
(String
a String that represents a month in German form
value
)

Parses a month having the string in German standard form such as "Oktober" or in German short form such as "Okt"

public static Month
public static Month[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

APRILback to summary
public static final Month APRIL
AUGUSTback to summary
public static final Month AUGUST
DECEMBERback to summary
public static final Month DECEMBER
FEBRUARYback to summary
public static final Month FEBRUARY
fullNameback to summary
private final String fullName
JANUARYback to summary
public static final Month JANUARY
JULYback to summary
public static final Month JULY
JUNEback to summary
public static final Month JUNE
MARCHback to summary
public static final Month MARCH
MAYback to summary
public static final Month MAY
NOVEMBERback to summary
public static final Month NOVEMBER
numberback to summary
private final int number
OCTOBERback to summary
public static final Month OCTOBER
SEPTEMBERback to summary
public static final Month SEPTEMBER
shortNameback to summary
private final String shortName
twoDigitNumberback to summary
private final String twoDigitNumber

Constructor Detail

Monthback to summary
private Month(String fullName, String shortName, int number)

Method Detail

getFullNameback to summary
public String getFullName()

Returns the name of the long in unabbreviated English.

Returns:String

Month

getJabRefFormatback to summary
public String getJabRefFormat()

Returns the month in JabRef format. The format is the short 3-digit name surrounded by a '#' (FieldWriter.BIBTEX_STRING_START_END_SYMBOL). Example: #jan#, #feb#, etc.

See Issue 263 for a discussion on that thing. This seems to be an invalid format in terms of plain BiBTeX, but a valid format in the case of JabRef. The documentation is available at the Strings help of JabRef.

Returns:String

Month in JabRef format

getMonthByNumberback to summary
public static Optional<Month> getMonthByNumber(int number)

Find month by one-based number. If the number is not in the valid range, then an empty Optional is returned.

Parameters
number:int

1-12 is valid

getMonthByShortNameback to summary
public static Optional<Month> getMonthByShortName(String shortName)

Find month by shortName (3 letters) case-insensitive. If no matching month is found, then an empty Optional is returned.

Parameters
shortName:String

"jan", "feb", ...

getNumberback to summary
public int getNumber()

Returns the number of the Month in a 1-indexed fashion: 1 -> January, 2 -> February etc.

Returns:int

number of the month in the Year

getShortNameback to summary
public String getShortName()

Returns the name of a Month in a short (3-letter) format. (jan, feb, mar, ...)

Returns:String

3-letter identifier for a Month

getTwoDigitNumberback to summary
public String getTwoDigitNumber()

Returns the number of the Month in a 1-indexed fashion using exactly two digits: 01 -> January, 02 -> February...

Returns:String

number of the month in the Year with two digits

isStrictFormatback to summary
public static boolean isStrictFormat(String value)

Checks if the value is in a strict BibTeX format.

A strict format is either a BibTeX string (e.g. #jun#) or an integer (e.g. 6). Plain text months (e.g. June) are considered non-strict.

Parameters
value:String

the string value to check

Returns:boolean

true if the value matches the strict format criteria

parseback to summary
public static Optional<Month> parse(String value)

This method accepts three types of months:

  • Single and Double Digit months from 1 to 12 (01 to 12)
  • 3 Digit BibTeX strings (jan, feb, mar...) possibly with # prepended
  • Full English month identifiers.
Parameters
value:String

the given value

Returns:Optional<Month>

the corresponding Month instance

parseGermanShortMonthback to summary
pack-priv static Optional<Month> parseGermanShortMonth(String value)

Parses a month having the string in German standard form such as "Oktober" or in German short form such as "Okt"

Parameters
value:String

a String that represents a month in German form

Returns:Optional<Month>

the corresponding month instance, empty if input is not in German form

valueOfback to summary
public static Month valueOf(String name)
valuesback to summary
public static Month[] values()