Package org.daisy.dotify.api.translator
Class DefaultTextAttribute
- java.lang.Object
-
- org.daisy.dotify.api.translator.DefaultTextAttribute
-
- All Implemented Interfaces:
Iterable<TextAttribute>
,TextAttribute
public class DefaultTextAttribute extends Object implements TextAttribute
Provides a default implementation of text attributes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultTextAttribute.Builder
Provides a builder for a default text attribute.
-
Field Summary
Fields Modifier and Type Field Description protected int
length
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultTextAttribute(int length, DefaultTextAttribute.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDictionaryIdentifier()
Gets the dictionary identifier that applies to this text attribute.int
getWidth()
Gets the width of this object.boolean
hasChildren()
Returns true if this object has text attribute children.Iterator<TextAttribute>
iterator()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
DefaultTextAttribute
protected DefaultTextAttribute(int length, DefaultTextAttribute.Builder builder)
-
-
Method Detail
-
getWidth
public int getWidth()
Description copied from interface:TextAttribute
Gets the width of this object.- Specified by:
getWidth
in interfaceTextAttribute
- Returns:
- returns the width, in characters
-
hasChildren
public boolean hasChildren()
Description copied from interface:TextAttribute
Returns true if this object has text attribute children.- Specified by:
hasChildren
in interfaceTextAttribute
- Returns:
- returns true if this object has a text attribute children, false otherwise
-
getDictionaryIdentifier
public String getDictionaryIdentifier()
Description copied from interface:TextAttribute
Gets the dictionary identifier that applies to this text attribute.- Specified by:
getDictionaryIdentifier
in interfaceTextAttribute
- Returns:
- returns the dictionary identifier, or null if it does not have any
-
iterator
public Iterator<TextAttribute> iterator()
- Specified by:
iterator
in interfaceIterable<TextAttribute>
-
-