Stay organized with collections Save and categorize content based on your preferences. 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 |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[]]