class SharedBuffer implements Serializable {

	public int put(
			final K key,
			final V value,
			final long timestamp,
			final K previousKey,
			final V previousValue,
			final long previousTimestamp,
			final int previousCounter,
			final DeweyNumber version) {

		final SharedBufferEntry<K, V> previousSharedBufferEntry =
				get(previousKey, previousValue, previousTimestamp, previousCounter);

		// sanity check whether we've found the previous element
		if (previousSharedBufferEntry == null && previousValue != null) {
			throw new IllegalStateException("Could not find previous entry with " +
				"key: " + previousKey + ", value: " + previousValue + " and timestamp: " +
				previousTimestamp + ". This can indicate that either you did not implement " +
				"the equals() and hashCode() methods of your input elements properly or that " +
				"the element belonging to that entry has been already pruned.");
		}

		return put(key, value, timestamp, previousSharedBufferEntry, version);
	}

	public  SharedBuffer();
	private  SharedBuffer(Map<K, SharedBufferPage<K, V>> pages);

}