@Immutable @MustImplementEqualsAndHashcode public class WidthSpec extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
WidthSpec.EWidthType
Defines the type of width unit of measure used.
|
| Constructor and Description |
|---|
WidthSpec(WidthSpec.EWidthType eType,
float fValue) |
| Modifier and Type | Method and Description |
|---|---|
static WidthSpec |
abs(float fValue)
Create a width element with an absolute value.
|
boolean |
equals(Object o) |
float |
getEffectiveValue(float fAvailableWidth)
Get the effective width based on the passed available width.
|
WidthSpec.EWidthType |
getType() |
String |
getTypeID() |
float |
getValue() |
int |
hashCode() |
boolean |
isStar() |
static WidthSpec |
perc(float fPerc)
Create a width element with an percentage value.
|
static WidthSpec |
star()
Create a new star width element.
|
String |
toString() |
public WidthSpec(@Nonnull WidthSpec.EWidthType eType, float fValue)
@Nonnull public WidthSpec.EWidthType getType()
null.@Nonnull @Nonempty public String getTypeID()
null.public boolean isStar()
true if type is 'star'.@Nonnegative public float getValue()
getType(). For star width elements this is
0.@Nonnegative public float getEffectiveValue(float fAvailableWidth)
fAvailableWidth - The available width.@Nonnull public static WidthSpec abs(@Nonnegative float fValue)
fValue - The width to use. Must be > 0.null.@Nonnull public static WidthSpec perc(@Nonnegative float fPerc)
fPerc - The width percentage to use. Must be > 0.null.Copyright © 2014–2016 Philip Helger. All rights reserved.