Package org.anchoranalysis.core.log
Class Divider
Object
Divider
Creates a line of text that span a certain width with a repeated character, optionally containing
a label.
- Author:
- Owen Feehan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char
The default character used in the divider, if not otherwise specified in the constructor.static final int
The default total nubmer of characters to use in the divier, if not otherwise specified in the constructor. -
Constructor Summary
ConstructorsConstructorDescriptionDivider()
A banner using dashes.Divider
(char characterToRepeat) A banner using a particular repeated character.Divider
(char characterToRepeat, int numberCharactersInBanner) A banner using a particular repeated character.Divider
(int numberCharactersInBanner) A banner using dashes, with a particular number of characters. -
Method Summary
Modifier and TypeMethodDescriptionCreates a line of repeated dashes with a centered label of text.Creates a line of repeated dashes.
-
Field Details
-
DEFAULT_CHARACTER
public static final char DEFAULT_CHARACTERThe default character used in the divider, if not otherwise specified in the constructor.- See Also:
-
DEFAULT_NUMBER_CHARACTERS_IN_BANNER
public static final int DEFAULT_NUMBER_CHARACTERS_IN_BANNERThe default total nubmer of characters to use in the divier, if not otherwise specified in the constructor.- See Also:
-
-
Constructor Details
-
Divider
public Divider()A banner using dashes. -
Divider
public Divider(int numberCharactersInBanner) A banner using dashes, with a particular number of characters.- Parameters:
numberCharactersInBanner
- the number of characters in the banner.
-
Divider
public Divider(char characterToRepeat) A banner using a particular repeated character.- Parameters:
characterToRepeat
- the character that is repeated.
-
Divider
public Divider(char characterToRepeat, int numberCharactersInBanner) A banner using a particular repeated character.- Parameters:
characterToRepeat
- the character that is repeated.numberCharactersInBanner
- the number of characters in the banner.
-
-
Method Details
-
withoutLabel
Creates a line of repeated dashes.- Returns:
- a string of repeated dashes to total 80 chracters.
-
withLabel
Creates a line of repeated dashes with a centered label of text.The label of text is padded by one character of whitespace on either side.
- Parameters:
label
- the label- Returns:
- a string of repreated dashes including a label to total 80 characters
-