PlayerBuffer
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-24 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-24 UTC."],[[["\u003cp\u003e\u003ccode\u003ePlayerBuffer\u003c/code\u003e provides access to a list of players using a data structure.\u003c/p\u003e\n"],["\u003cp\u003eIt extends \u003ccode\u003eAbstractDataBuffer\u003c/code\u003e and allows retrieval of individual \u003ccode\u003ePlayer\u003c/code\u003e objects using the \u003ccode\u003eget(int position)\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eIncludes methods for managing the buffer's lifecycle, such as \u003ccode\u003eclose()\u003c/code\u003e and \u003ccode\u003erelease()\u003c/code\u003e, inherited from interfaces like \u003ccode\u003eDataBuffer\u003c/code\u003e and \u003ccode\u003eReleasable\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eInherits common data access methods like \u003ccode\u003egetCount()\u003c/code\u003e, \u003ccode\u003eiterator()\u003c/code\u003e, and \u003ccode\u003eisClosed()\u003c/code\u003e from \u003ccode\u003eAbstractDataBuffer\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eProvides a way to iterate through the list of \u003ccode\u003ePlayer\u003c/code\u003e objects efficiently.\u003c/p\u003e\n"]]],["The `PlayerBuffer` class provides a data structure for accessing a list of `Player` objects. Key actions include retrieving a `Player` object by its position using the `get(int position)` method. It also offers inherited methods like `getCount()` to get the number of players, `isClosed()` to check if the buffer is closed and methods to iterate through the player list using the `iterator()` or `singleRefIterator()` methods. Additionally it allows release the memory used with `release()` and close the buffer with `close()`.\n"],null,["# PlayerBuffer\n\npublic class **PlayerBuffer** extends [AbstractDataBuffer](/android/reference/com/google/android/gms/common/data/AbstractDataBuffer)\\\u003c[Player](/android/games_v1/reference/com/google/android/gms/games/Player)\\\u003e \nData structure providing access to a list of players. \n\n### Public Method Summary\n\n|---------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|\n| [Player](/android/games_v1/reference/com/google/android/gms/games/Player) | [get](/android/games_v1/reference/com/google/android/gms/games/PlayerBuffer#get(int))(int position) |\n\n### Inherited Method Summary\n\nFrom class com.google.android.gms.common.data.AbstractDataBuffer \n\n|----------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|\n| final void | close() |\n| abstract [Player](/android/games_v1/reference/com/google/android/gms/games/Player) | get(int arg0) |\n| int | getCount() |\n| boolean | isClosed() |\n| [Iterator](//developer.android.com/reference/java/util/Iterator.html)\\\u003c[Player](/android/games_v1/reference/com/google/android/gms/games/Player)\\\u003e | iterator() |\n| void | release() |\n| [Iterator](//developer.android.com/reference/java/util/Iterator.html)\\\u003c[Player](/android/games_v1/reference/com/google/android/gms/games/Player)\\\u003e | singleRefIterator() |\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface com.google.android.gms.common.data.DataBuffer \n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|\n| abstract void | close() |\n| abstract [Player](/android/games_v1/reference/com/google/android/gms/games/Player) | get(int arg0) |\n| abstract int | getCount() |\n| abstract boolean | isClosed() |\n| abstract [Iterator](//developer.android.com/reference/java/util/Iterator.html)\\\u003c[Player](/android/games_v1/reference/com/google/android/gms/games/Player)\\\u003e | iterator() |\n| void | release() |\n| abstract [Iterator](//developer.android.com/reference/java/util/Iterator.html)\\\u003c[Player](/android/games_v1/reference/com/google/android/gms/games/Player)\\\u003e | singleRefIterator() |\n\nFrom interface java.lang.Iterable \n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| void | forEach([Consumer](//developer.android.com/reference/java/util/function/Consumer.html)\\\u003c? super T\\\u003e arg0) |\n| abstract [Iterator](//developer.android.com/reference/java/util/Iterator.html)\\\u003c[Player](/android/games_v1/reference/com/google/android/gms/games/Player)\\\u003e | iterator() |\n| [Spliterator](//developer.android.com/reference/java/util/Spliterator.html)\\\u003c[Player](/android/games_v1/reference/com/google/android/gms/games/Player)\\\u003e | spliterator() |\n\nFrom interface com.google.android.gms.common.api.Releasable \n\n|---------------|-----------|\n| abstract void | release() |\n\nFrom interface java.io.Closeable \n\n|---------------|---------|\n| abstract void | close() |\n\nFrom interface java.lang.AutoCloseable \n\n|---------------|---------|\n| abstract void | close() |\n\nPublic Methods\n--------------\n\n#### public [Player](/android/games_v1/reference/com/google/android/gms/games/Player)\n**get** (int position)"]]