Package org.daisy.dotify.api.translator
Class DefaultAttributeWithContext
- java.lang.Object
-
- org.daisy.dotify.api.translator.DefaultAttributeWithContext
-
- All Implemented Interfaces:
Iterable<AttributeWithContext>,AttributeWithContext
public class DefaultAttributeWithContext extends Object implements AttributeWithContext
Provides a default implementation of attributes with context.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultAttributeWithContext.BuilderProvides a builder for a default text attribute
-
Field Summary
Fields Modifier and Type Field Description protected intlength
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultAttributeWithContext(int length, DefaultAttributeWithContext.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>getName()Gets the name of this attribute.intgetWidth()Gets the width of this attribute.booleanhasChildren()Returns true if this attribute has children.Iterator<AttributeWithContext>iterator()StringtoString()-
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
-
DefaultAttributeWithContext
protected DefaultAttributeWithContext(int length, DefaultAttributeWithContext.Builder builder)
-
-
Method Detail
-
getWidth
public int getWidth()
Description copied from interface:AttributeWithContextGets the width of this attribute.- Specified by:
getWidthin interfaceAttributeWithContext- Returns:
- the width, in items
-
hasChildren
public boolean hasChildren()
Description copied from interface:AttributeWithContextReturns true if this attribute has children.- Specified by:
hasChildrenin interfaceAttributeWithContext- Returns:
- true if this attribute has children, false otherwise
-
getName
public Optional<String> getName()
Description copied from interface:AttributeWithContextGets the name of this attribute.- Specified by:
getNamein interfaceAttributeWithContext- Returns:
- an optional containing the attribute name, or an empty optional if it does not have any
-
iterator
public Iterator<AttributeWithContext> iterator()
- Specified by:
iteratorin interfaceIterable<AttributeWithContext>
-
-