|
RuneHive-Game
|
Represents a sector within some Cache.
More...
Public Member Functions | |
| void | check (int cacheId, int indexId, int chunk) |
| Tests whether or not this sector is valid. | |
| int | getCacheId () |
| Returns the id of the cache this sector is in. | |
| int | getChunk () |
| Returns this sectors chunk. | |
| int | getIndexId () |
| Returns the id of the index this sector is within. | |
| int | getNextIndexId () |
| Returns the next index within this sector. | |
Static Public Member Functions | |
| static Sector | decode (ByteBuffer buffer, byte[] data, int offset, int length) |
Decodes a Sector from the specified ByteBuffer. | |
Private Member Functions | |
| Sector (int indexId, int chunk, int nextIndexId, int cacheId) | |
Constructs a new Sector with the expected index id, chunk, next index id and cache id. | |
Private Attributes | |
| final int | cacheId |
| The id of the cache this sector is in. | |
| final int | chunk |
| This sectors chunk. | |
| final int | indexId |
| The id of the index this sector is within. | |
| final int | nextIndexId |
| The next index within this sector. | |
Represents a sector within some Cache.
Definition at line 13 of file Sector.java.
|
private |
Constructs a new Sector with the expected index id, chunk, next index id and cache id.
This constructor is marked private and should not be modified to be invoked directly, use Sector#decode(ByteBuffer, byte[], int, int) instead.
| indexId | The id of the index this sector is within. |
| chunk | This sectors chunk. |
| nextIndexId | The next index within this sector. |
| cacheId | The id of the cache this sector is in. |
Definition at line 38 of file Sector.java.
References cacheId, chunk, indexId, and nextIndexId.
Referenced by decode().
| void com.runehive.fs.cache.Sector.check | ( | int | cacheId, |
| int | indexId, | ||
| int | chunk ) |
Tests whether or not this sector is valid.
| cacheId | The cache id to test. |
| indexId | The index id to test. |
| chunk | The chunk id to test. |
Definition at line 70 of file Sector.java.
References cacheId, chunk, and indexId.
Referenced by com.runehive.fs.cache.Cache.get().
|
static |
Decodes a Sector from the specified ByteBuffer.
| buffer | The ByteBuffer to get the sector from. |
| data | The expected data within the sector. |
| offset | The expected offset of the sector. |
| length | The expected length of the sector. |
Definition at line 54 of file Sector.java.
References cacheId, chunk, com.runehive.fs.util.ByteBufferUtil.getMedium(), indexId, nextIndexId, and Sector().
Referenced by com.runehive.fs.cache.Cache.readSector().
| int com.runehive.fs.cache.Sector.getCacheId | ( | ) |
Returns the id of the cache this sector is in.
Definition at line 92 of file Sector.java.
References cacheId.
| int com.runehive.fs.cache.Sector.getChunk | ( | ) |
Returns this sectors chunk.
Definition at line 82 of file Sector.java.
References chunk.
| int com.runehive.fs.cache.Sector.getIndexId | ( | ) |
Returns the id of the index this sector is within.
Definition at line 77 of file Sector.java.
References indexId.
| int com.runehive.fs.cache.Sector.getNextIndexId | ( | ) |
Returns the next index within this sector.
Definition at line 87 of file Sector.java.
References nextIndexId.
Referenced by com.runehive.fs.cache.Cache.get().
|
private |
The id of the cache this sector is in.
Definition at line 25 of file Sector.java.
Referenced by check(), decode(), getCacheId(), and Sector().
|
private |
This sectors chunk.
Definition at line 19 of file Sector.java.
Referenced by check(), decode(), getChunk(), and Sector().
|
private |
The id of the index this sector is within.
Definition at line 16 of file Sector.java.
Referenced by check(), decode(), getIndexId(), and Sector().
|
private |
The next index within this sector.
Definition at line 22 of file Sector.java.
Referenced by decode(), getNextIndexId(), and Sector().