java.lang.Object
org.refcodes.textual.ColumnWidthMetricsImpl
- All Implemented Interfaces:
org.refcodes.mixin.ColumnWidthAccessor
,org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<ColumnWidthMetrics>
,org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
,org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
,ColumnWidthMetrics
- Direct Known Subclasses:
ColumnFormatMetricsImpl
public class ColumnWidthMetricsImpl extends Object implements ColumnWidthMetrics
Implementation of the
ColumnWidthMetrics
interface.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.ColumnWidthAccessor
org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B extends org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B>>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
-
Constructor Summary
Constructors Constructor Description ColumnWidthMetricsImpl()
Instantiates a new column width metrics impl.ColumnWidthMetricsImpl(int aWidth, ColumnWidthType aWidthType)
Constructs a column's width, either in percent (%) or in number of chars. -
Method Summary
Modifier and Type Method Description int
getColumnWidth()
ColumnWidthType
getColumnWidthType()
The type of the width being provided, either percent (%) or number of chars.void
setColumnWidth(int aColumnWidth)
void
setColumnWidthType(ColumnWidthType aColumnWidthType)
Sets the column width type.String
toString()
ColumnWidthMetrics
withColumnWidth(int aColumnWidth)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
letColumnWidth
Methods inherited from interface org.refcodes.textual.ColumnWidthMetrics
fromColumnWidthMetrics, withColumnWidthType
-
Constructor Details
-
ColumnWidthMetricsImpl
public ColumnWidthMetricsImpl()Instantiates a new column width metrics impl. -
ColumnWidthMetricsImpl
Constructs a column's width, either in percent (%) or in number of chars.- Parameters:
aWidth
- The width for the column, either in percent (%) or in number of chars, depending on the providedColumnWidthType
.aWidthType
- The type of the width being provided, either percent (%) or number of chars.
-
-
Method Details
-
getColumnWidth
public int getColumnWidth()- Specified by:
getColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor
-
toString
-
setColumnWidth
public void setColumnWidth(int aColumnWidth)- Specified by:
setColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
-
withColumnWidth
- Specified by:
withColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<ColumnWidthMetrics>
-
getColumnWidthType
The type of the width being provided, either percent (%) or number of chars.- Specified by:
getColumnWidthType
in interfaceColumnWidthMetrics
- Returns:
- The column's width type, either percent (%) or number of chars.
-
setColumnWidthType
Sets the column width type.- Specified by:
setColumnWidthType
in interfaceColumnWidthMetrics
- Parameters:
aColumnWidthType
- the new column width type
-