Package org.refcodes.textual
Class ColumnWidthMetricsImpl
- 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 java.lang.Object implements ColumnWidthMetrics
Implementation of theColumnWidthMetrics
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
All Methods Instance Methods Concrete Methods 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.java.lang.String
toString()
ColumnWidthMetrics
withColumnWidth(int aColumnWidth)
-
Methods inherited from interface org.refcodes.textual.ColumnWidthMetrics
fromColumnWidthMetrics, withColumnWidthType
-
-
-
-
Constructor Detail
-
ColumnWidthMetricsImpl
public ColumnWidthMetricsImpl()
Instantiates a new column width metrics impl.
-
ColumnWidthMetricsImpl
public ColumnWidthMetricsImpl(int aWidth, ColumnWidthType aWidthType)
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 Detail
-
getColumnWidth
public int getColumnWidth()
- Specified by:
getColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setColumnWidth
public void setColumnWidth(int aColumnWidth)
- Specified by:
setColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
-
withColumnWidth
public ColumnWidthMetrics withColumnWidth(int aColumnWidth)
- Specified by:
withColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<ColumnWidthMetrics>
-
getColumnWidthType
public ColumnWidthType 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
public void setColumnWidthType(ColumnWidthType aColumnWidthType)
Sets the column width type.- Specified by:
setColumnWidthType
in interfaceColumnWidthMetrics
- Parameters:
aColumnWidthType
- the new column width type
-
-