|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbarsuift.simLife.Percent
public class Percent
Immutable percent number.
| Constructor Summary | |
|---|---|
Percent()
Creates a random percentage value |
|
Percent(java.math.BigDecimal value)
Creates a percent from given BigDecimal value |
|
Percent(int value)
Creates a percent from given int value |
|
Percent(Percent percent)
Creates a percent which is a copy of the given percent |
|
Percent(PercentState percentState)
Creates a percent from given PercentState value |
|
| Method Summary | |
|---|---|
int |
compareTo(Percent o)
|
boolean |
equals(java.lang.Object obj)
|
int |
getIntValue()
|
PercentState |
getState()
|
java.math.BigDecimal |
getValue()
|
int |
hashCode()
|
java.lang.String |
toString()
Return a formatted string representing the percent value, in the form xx.00% |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Percent()
public Percent(Percent percent)
percent - the percent to copy value from
java.lang.NullPointerException - if given percent is nullpublic Percent(PercentState percentState)
percentState - must be between 0 and 1 (and not null)
java.lang.IllegalArgumentException - if the given value is not between 0 and 1 (or is null)public Percent(int value)
value - must be between 0 and 100
java.lang.IllegalArgumentException - if the given value is not between 0 and 100public Percent(java.math.BigDecimal value)
value - must be between 0 and 1 (and not null)
java.lang.IllegalArgumentException - if the given value is not between 0 and 1 (or is null)| Method Detail |
|---|
public java.math.BigDecimal getValue()
public int getIntValue()
public PercentState getState()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(Percent o)
compareTo in interface java.lang.Comparable<Percent>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||