RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.fs.cache.Index Class Reference

Represents an index within some Cache. More...

Public Member Functions

boolean check ()
 Tests whether or not this index is valid.
int getId ()
 Returns the id of this index.
int getLength ()
 Returns the length of this index.

Static Public Member Functions

static Index decode (ByteBuffer buffer)
 Decodes an Index from the specified ByteBuffer.

Private Member Functions

 Index (int length, int id)
 Constructs a new Index with the expected length and id.

Private Attributes

final int id
 The id of the index.
final int length
 The length of the index.

Detailed Description

Represents an index within some Cache.

Author
Ryley Kimmel ryley.nosp@m..kim.nosp@m.mel@l.nosp@m.ive..nosp@m.com
Artem Batutin artem.nosp@m.batu.nosp@m.tin@g.nosp@m.mail.nosp@m..com

Definition at line 13 of file Index.java.

Constructor & Destructor Documentation

◆ Index()

com.runehive.fs.cache.Index.Index ( int length,
int id )
private

Constructs a new Index with the expected length and id.

This constructor is marked private and should not be modified to be invoked directly, use Index#decode(ByteBuffer) instead.

Parameters
lengthThe length of the index.
idThe id of the index.

Definition at line 29 of file Index.java.

29 {
30 this.length = length;
31 this.id = id;
32 }

References id, and length.

Referenced by decode().

Here is the caller graph for this function:

Member Function Documentation

◆ check()

boolean com.runehive.fs.cache.Index.check ( )

Tests whether or not this index is valid.

Definition at line 57 of file Index.java.

57 {
58 return length > 0;
59 }

References length.

◆ decode()

Index com.runehive.fs.cache.Index.decode ( ByteBuffer buffer)
static

Decodes an Index from the specified ByteBuffer.

Parameters
bufferThe ByteBuffer to get the index from.
Returns
The decoded index.

Definition at line 40 of file Index.java.

40 {
41 int length = ByteBufferUtil.getMedium(buffer);
42 int id = ByteBufferUtil.getMedium(buffer);
43 return new Index(length, id);
44 }

References com.runehive.fs.util.ByteBufferUtil.getMedium(), Index(), and length.

Referenced by com.runehive.fs.cache.Cache.readIndex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getId()

int com.runehive.fs.cache.Index.getId ( )

Returns the id of this index.

Definition at line 47 of file Index.java.

47 {
48 return id;
49 }

References id.

◆ getLength()

int com.runehive.fs.cache.Index.getLength ( )

Returns the length of this index.

Definition at line 52 of file Index.java.

52 {
53 return length;
54 }

References length.

Member Data Documentation

◆ id

final int com.runehive.fs.cache.Index.id
private

The id of the index.

Definition at line 19 of file Index.java.

Referenced by getId(), and Index().

◆ length

final int com.runehive.fs.cache.Index.length
private

The length of the index.

Definition at line 16 of file Index.java.

Referenced by check(), decode(), getLength(), and Index().


The documentation for this class was generated from the following file: