Package org.dellroad.stuff.text
Class MessageFmt.Segment
java.lang.Object
org.dellroad.stuff.text.MessageFmt.Segment
- Direct Known Subclasses:
MessageFmt.ArgumentSegment
,MessageFmt.TextSegment
- Enclosing class:
- MessageFmt
Represents one atomic portion of a
MessageFormat
pattern string.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
abstract String
Encode this segment as aMessageFormat
pattern fragment.abstract void
visit
(MessageFmt.SegmentSwitch target) Visit the method of the given switch corresponding to this instance's concrete type.
-
Constructor Details
-
Segment
public Segment()
-
-
Method Details
-
toPattern
Encode this segment as aMessageFormat
pattern fragment.The concatenation of the encoding of the
MessageFmt.Segment
s in aMessageFmt
produces the correspondingMessageFormat
pattern string.This method is responsible for escaping single quotes and opening curly braces, if necessary.
- Returns:
MessageFormat
pattern string text
-
visit
Visit the method of the given switch corresponding to this instance's concrete type.- Parameters:
target
- visitor pattern target
-
equals
-
hashCode
public int hashCode()
-