public class AverageDecimal extends Object implements Iterator<BigDecimal>
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
get(int i) |
BigDecimal |
getAvgValue() |
int |
getFixCount() |
BigDecimal |
getFixValue() |
BigDecimal |
getPrecision() |
boolean |
hasNext() |
static void |
main(String[] args) |
BigDecimal |
next() |
static AverageDecimal |
of(BigDecimal total,
int count)
average the mumber with the count, and the scale is 2 (0.01)
20/6 = [3.33, 3.33, 3.34, 3.33, 3.33, 3.34]
|
static AverageDecimal |
of(BigDecimal total,
int count,
int scale)
average the mumber with the count, and the assigned scale
20/6 = [3.33, 3.33, 3.34, 3.33, 3.33, 3.34]
|
void |
remove() |
void |
reset() |
int |
scale() |
int |
size() |
String |
toString() |
BigDecimal |
total() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachRemainingpublic static AverageDecimal of(BigDecimal total, int count)
total - the number to be averagedcount - the partpublic static AverageDecimal of(BigDecimal total, int count, int scale)
total - the number to be averagedcount - the partscale - the item's scalepublic boolean hasNext()
hasNext in interface Iterator<BigDecimal>public BigDecimal next()
next in interface Iterator<BigDecimal>public void remove()
remove in interface Iterator<BigDecimal>public void reset()
public BigDecimal get(int i)
public int size()
public BigDecimal total()
public int scale()
public BigDecimal getPrecision()
public BigDecimal getAvgValue()
public BigDecimal getFixValue()
public int getFixCount()
public static void main(String[] args)
Copyright © 2020. All rights reserved.