Class PageNumberReference
- java.lang.Object
-
- org.daisy.dotify.formatter.impl.segment.PageNumberReference
-
- All Implemented Interfaces:
FollowingText,PrecedingText,ResolvableText,Segment
public class PageNumberReference extends Object implements Segment
Provides a page number reference event object.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.daisy.dotify.formatter.impl.segment.Segment
Segment.SegmentType
-
-
Constructor Summary
Constructors Constructor Description PageNumberReference(String refid, NumeralStyle style, boolean markCapitalLetters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)NumeralStylegetNumeralStyle()Gets the numeral style for this page number reference.StringgetRefId()Gets the identifier to the reference location.Segment.SegmentTypegetSegmentType()inthashCode()booleanisStatic()Returns true if this item does not change.Stringpeek()Peeks the value of this item.Stringresolve()Resolves the item.voidsetResolver(Function<PageNumberReference,String> v)booleanshouldMarkCapitalLetters()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.daisy.dotify.formatter.impl.segment.Segment
getLocale, shouldHyphenate
-
-
-
-
Constructor Detail
-
PageNumberReference
public PageNumberReference(String refid, NumeralStyle style, boolean markCapitalLetters)
-
-
Method Detail
-
getRefId
public String getRefId()
Gets the identifier to the reference location.- Returns:
- returns the reference identifier
-
getNumeralStyle
public NumeralStyle getNumeralStyle()
Gets the numeral style for this page number reference.- Returns:
- returns the numeral style
-
getSegmentType
public Segment.SegmentType getSegmentType()
- Specified by:
getSegmentTypein interfaceSegment
-
peek
public String peek()
Description copied from interface:ResolvableTextPeeks the value of this item. The returned string may be different from call to call.Note that after a call to
ResolvableText.resolve(), this method should consistently return the same result.- Specified by:
peekin interfaceFollowingText- Specified by:
peekin interfaceResolvableText- Returns:
- the value, never null
-
resolve
public String resolve()
Description copied from interface:ResolvableTextResolves the item. Once the value has been resolved, it cannot change between calls in the same context. This applies to bothResolvableText.peek()andResolvableText.resolve().- Specified by:
resolvein interfacePrecedingText- Specified by:
resolvein interfaceResolvableText- Returns:
- the value, never null
-
setResolver
public void setResolver(Function<PageNumberReference,String> v)
-
isStatic
public boolean isStatic()
Description copied from interface:FollowingTextReturns true if this item does not change.- Specified by:
isStaticin interfaceFollowingText- Returns:
- true if this item is static, false otherwise
-
shouldMarkCapitalLetters
public boolean shouldMarkCapitalLetters()
- Specified by:
shouldMarkCapitalLettersin interfaceSegment
-
-