and - "and" with surrounding spaces),
then the field text is replaced with the first argument,
otherwise it is replaced with the second.
For example, \format[IfPlural(Eds.,Ed.)]{\editor}
should expand to Eds. if the document has more than one editor and Ed. if it only has one.
| Modifier and Type | Field and Description |
|---|---|
| private static final Pattern | |
| private String | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | format(String fieldText)
Implements org. Failure Mode: Formatters should be robust in the sense that they always return some relevant string. |
| public void | setArgument(String arg)
Implements org. Method for setting the argument of this formatter. |
| AND_PATTERN | back to summary |
|---|---|
| private static final Pattern AND_PATTERN | |
| pluralText | back to summary |
|---|---|
| private String pluralText | |
| singularText | back to summary |
|---|---|
| private String singularText | |
| IfPlural | back to summary |
|---|---|
| public IfPlural() | |
| format | back to summary |
|---|---|
| public String format(String fieldText) Implements org. Doc from org. Failure Mode: Formatters should be robust in the sense that they always return some relevant string. If the formatter can detect an invalid input it should return the original string otherwise it may simply return a wrong output.
| |
| setArgument | back to summary |
|---|---|
| public void setArgument(String arg) Implements org. Doc from org. Method for setting the argument of this formatter.
| |