| 17 | import java.util.concurrent.locks.ReentrantReadWriteLock; |
| 18 | |
| 19 | public class Ref extends ARef implements IFn, Comparable<Ref>, IRef{ |
| 20 | public int compareTo(Ref ref) { |
| 21 | if(this.id == ref.id) |
| 22 | return 0; |
| 23 | else if(this.id < ref.id) |
| 24 | return -1; |
| 25 | else |
| 26 | return 1; |
| 27 | } |
| 28 | |
| 29 | public int getMinHistory(){ |
| 30 | return minHistory; |
| 31 | } |
| 32 | |
| 33 | public Ref setMinHistory(int minHistory){ |
| 34 | this.minHistory = minHistory; |
| 35 | return this; |
| 36 | } |
| 37 | |
| 38 | public int getMaxHistory(){ |
| 39 | return maxHistory; |
| 40 | } |
| 41 | |
| 42 | public Ref setMaxHistory(int maxHistory){ |
| 43 | this.maxHistory = maxHistory; |
| 44 | return this; |
| 45 | } |
| 46 | |
| 47 | public static class TVal{ |
| 48 | Object val; |
| 49 | long point; |
| 50 | TVal prior; |
| 51 | TVal next; |
| 52 | |
| 53 | TVal(Object val, long point, TVal prior){ |
| 54 | this.val = val; |
| 55 | this.point = point; |
| 56 | this.prior = prior; |
| 57 | this.next = prior.next; |
| 58 | this.prior.next = this; |
| 59 | this.next.prior = this; |
| 60 | } |
| 61 | |
| 62 | TVal(Object val, long point){ |
| 63 | this.val = val; |
| 64 | this.point = point; |
| 65 | this.next = this; |
| 66 | this.prior = this; |
| 67 | } |
| 68 | |
| 69 | } |
| 70 | |
| 71 | TVal tvals; |
| 72 | final AtomicInteger faults; |
| 73 | final ReentrantReadWriteLock lock; |
| 74 | LockingTransaction.Info tinfo; |
| 75 | //IFn validator; |
| 76 | final long id; |
nothing calls this directly
no outgoing calls
no test coverage detected