TransactionEntry.java :  » GWT » jstm4gwt » jstm4gwt » core » Java Open Source

Java Open Source » GWT » jstm4gwt 
jstm4gwt » jstm4gwt » core » TransactionEntry.java
/**
 * 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();
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.