簡單統計
public class SimpleStats
extends Object
java.lang.Object | |
↳ | com.android.tradefed.util.SimpleStats |
一個小型實用程式類,用於根據給定的數值資料集計算一些統計度量。這些值在內部儲存為Double
。
概括
公共構造函數 | |
---|---|
SimpleStats () |
公共方法 | |
---|---|
void | add (double meas) 將測量新增至資料集。 |
void | addAll ( c) addAll ( c) 將許多測量值新增至資料集中。 |
getData () 檢索資料集。 | |
boolean | isEmpty () 檢查資料集是否為空。 |
Double | max () 傳回資料集中的最大值,如果資料集為空,則傳回 |
Double | mean () 計算並傳回資料集的平均值,如果資料集為空,則傳回 |
Double | meanOverOneStandardDeviationRange () 傳回一個標準差內樣本的平均值,例如 2.55 50.3 50.4 48.5 50.1 29.8 30 46 48 49 平均值:40.45,標準差:15.54 一個標準差內的值平均值為:44.67 |
Double | median () 計算並傳回資料集的中位數,如果資料集為空,則傳回 |
Double | min () 傳回資料集中的最小值,如果資料集為空,則傳回 |
int | size () 檢查資料集中有多少個元素。 |
Double | stdev () 傳回資料集的標準差,如果資料集為空,則傳回 |
公共構造函數
簡單統計
public SimpleStats ()
公共方法
添加
public void add (double meas)
將測量新增至資料集。
參數 | |
---|---|
meas | double |
全部添加
public void addAll (c)
將許多測量值新增至資料集中。
參數 | |
---|---|
c |
投擲 | |
---|---|
NullPointerException | 如果集合包含任何null 元素 |
取得數據
publicgetData ()
檢索資料集。
退貨 | |
---|---|
是空的
public boolean isEmpty ()
檢查資料集是否為空。
退貨 | |
---|---|
boolean |
最大限度
public Double max ()
傳回資料集中的最大值,如果資料集為空,則傳回null
。
退貨 | |
---|---|
Double |
意思是
public Double mean ()
計算並傳回資料集的平均值,如果資料集為空,則傳回null
。
退貨 | |
---|---|
Double |
平均超過一個標準差範圍
public Double meanOverOneStandardDeviationRange ()
傳回一個標準差內樣本的平均值,例如 2.55 50.3 50.4 48.5 50.1 29.8 30 46 48 49 平均值:40.45,標準差:15.54 一個標準差內的值平均值為:44.67
退貨 | |
---|---|
Double |
中位數
public Double median ()
計算並傳回資料集的中位數,如果資料集為空,則傳回null
。
退貨 | |
---|---|
Double |
分分鐘
public Double min ()
傳回資料集中的最小值,如果資料集為空,則傳回null
。
退貨 | |
---|---|
Double |
尺寸
public int size ()
檢查資料集中有多少個元素。
退貨 | |
---|---|
int |
標準開發
public Double stdev ()
傳回資料集的標準差,如果資料集為空,則傳回null
。
SimpleStats
實例中。退貨 | |
---|---|
Double |