Mercurial > hg > Members > tatsuki > bench > jungle-core
view src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeRepository.java @ 10:a2c019a77c27
commit
author | Shoshi TAMAKI |
---|---|
date | Mon, 10 Dec 2012 18:50:53 +0900 |
parents | |
children | df42dca47c3e |
line wrap: on
line source
package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl; import java.util.concurrent.atomic.AtomicReference; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Constants; import fj.data.List; public class TreeRepository { private final AtomicReference<ChangeSetImpl> changeSet; public TreeRepository() { List<Command> emptyCommands = List.nil(); changeSet = new AtomicReference<ChangeSetImpl>( new ChangeSetImpl(TreeImpl.EMPTY,emptyCommands, Constants.DEFAULT_OWNER,Constants.DEFAULT_REVISION_START_NUMBER,null) ); } public ChangeSetImpl getCurrentChangeSet() { return changeSet.get(); } public boolean commitChangeSet(ChangeSetImpl _newChangeSet,ChangeSetImpl _currentChangeSet) { return changeSet.compareAndSet(_currentChangeSet,_newChangeSet); } }