/** Holds a piece of data and a long size.
  * @param <D>  the type of data. */
class MeasuredData<D> {
  
  private D data;
  private long size;
  
  /** A MeasuredData with given data and size.
    * @param data  data to hold.
    * @param size  size to hold. */
  public MeasuredData(D data, long size) {
    this.data = data;
    this.size = size;
  }
  
  /** Return the stored piece of data.
    * @return  the piece of data. */
  public D getData() {
    return data;
  }
  /** Return the stored size.
    * @return  the size. */
  public long getSize() {
    return size;
  }
  
  /** Return a string representation in the form "data: size".
    * If the data is null, "null" is its representation.
    * @return  a string representation in the form "data: size". */
  public String toString() {
    return "" + data + ": " + size;
  }
  
}


