Package uk.ac.bristol.star.cdf.record
Class Pointer
java.lang.Object
uk.ac.bristol.star.cdf.record.Pointer
Keeps track of a file offset.
- Since:
- 18 Jun 2013
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
get()
Returns this pointer's current value.long
getAndIncrement
(int increment) Returns this pointer's current value and increments it by a given step.void
set
(long value) Sets this pointer's current value.
-
Constructor Details
-
Pointer
public Pointer(long value) Constructor.- Parameters:
value
- initial value
-
-
Method Details
-
get
public long get()Returns this pointer's current value.- Returns:
- value
-
getAndIncrement
public long getAndIncrement(int increment) Returns this pointer's current value and increments it by a given step.- Parameters:
increment
- amount to increase value by- Returns:
- pre-increment value
-
set
public void set(long value) Sets this pointer's current value.- Parameters:
value
- new value
-