edu.harvard.deas.hyperenc.vsat
Class VSatPage

java.lang.Object
  extended by edu.harvard.deas.hyperenc.vsat.VSatPage
All Implemented Interfaces:
Serializable

public class VSatPage
extends Object
implements Serializable

A page of data. Contains an array of bytes (the data), and an integer counter that can be used to count the number of times a page has been accessed. The data contained in a VSatPage is immutable, and the counter may only be incremented.

See Also:
Serialized Form

Constructor Summary
VSatPage(byte[] data)
          Creates a new VSatPage with the specified data.
 
Method Summary
 int getCount()
          Returns the current value of the counter.
 byte[] getData()
          This page's data, as a byte array.
 void increment()
          Adds 1 to the counter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VSatPage

public VSatPage(byte[] data)
Creates a new VSatPage with the specified data. The data array is copied into the constructed object; subsequent mutations of the passed array do not affect this object.

Parameters:
data - Data for this page.
Method Detail

getData

public byte[] getData()
This page's data, as a byte array. The returned array is a copy; modifications to the returned array do not affect this VSatPage.

Returns:
a copy of this page's data

increment

public void increment()
Adds 1 to the counter.


getCount

public int getCount()
Returns the current value of the counter.

Returns:
the counter