/**
* JSTM (http://xstm.net)
* Distributed under the Apache License Version 2.0
* Copyright xstm.net
*/
package jstm4gwt.core;
/**
* Transactions use this class to store their private versions of transactional
* objects. Fields are final to prevent threads to see incomplete entries.
*/
final class TransactionEntry {
private final TObject _key;
private final TransactionEntry _next;
private final TObject.Version _value;
public TransactionEntry(TObject key, TObject.Version value, TransactionEntry next) {
if (key == null || value == null)
throw new IllegalArgumentException();
_key = key;
_value = value;
_next = next;
}
public TObject getKey() {
return _key;
}
public TransactionEntry getNext() {
return _next;
}
public TObject.Version getValue() {
return _value;
}
@Override
public String toString() {
return getKey() + " = " + getValue();
}
}
|