NetworkStats
class NetworkStats : AutoCloseable
Class providing enumeration over buckets of network usage statistics. NetworkStats
objects are returned as results to various queries in NetworkStatsManager
.
Summary
Nested classes |
|
Buckets are the smallest elements of a query result.
|
Public methods |
Unit |
Closes the enumeration.
|
Boolean |
Fills the recycled bucket with data of the next bin in the enumeration.
|
Boolean |
Check if it is possible to ask for a next bucket in the enumeration.
|
Public methods
close
fun close(): Unit
Closes the enumeration. Call this method before this object gets out of scope.
Exceptions |
java.lang.Exception |
if this resource cannot be closed |
getNextBucket
fun getNextBucket(bucketOut: NetworkStats.Bucket?): Boolean
Fills the recycled bucket with data of the next bin in the enumeration.
Parameters |
bucketOut |
NetworkStats.Bucket?: Bucket to be filled with data. If null, the method does nothing and returning false. |
Return |
Boolean |
true if successfully filled the bucket, false otherwise. |
hasNextBucket
fun hasNextBucket(): Boolean
Check if it is possible to ask for a next bucket in the enumeration.
Return |
Boolean |
true if there is at least one more bucket. |
Protected methods
finalize
protected fun finalize(): Unit
Exceptions |
java.lang.Throwable |
the Exception raised by this method |