SCViewer/com.minres.scviewer.databas.../src/com/minres/scviewer/database/text/Tx.groovy

62 lines
1.4 KiB
Groovy
Raw Normal View History

2012-06-17 20:34:50 +02:00
/*******************************************************************************
* Copyright (c) 2012 IT Just working.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IT Just working - initial API and implementation
*******************************************************************************/
package com.minres.scviewer.database.text
2012-06-17 20:34:50 +02:00
import com.minres.scviewer.database.*
2012-06-17 19:53:05 +02:00
2015-01-06 17:14:16 +01:00
class Tx implements ITx {
2015-01-01 23:17:32 +01:00
2012-06-17 19:53:05 +02:00
Long id
2015-01-01 23:17:32 +01:00
2015-01-06 17:14:16 +01:00
TxGenerator generator
2015-01-01 23:17:32 +01:00
2015-01-06 17:14:16 +01:00
TxStream stream
2015-01-01 23:17:32 +01:00
2015-01-20 18:50:15 +01:00
int concurrencyIndex
Long beginTime
2015-01-01 23:17:32 +01:00
2015-01-20 18:50:15 +01:00
Long endTime
2015-01-01 23:17:32 +01:00
2015-01-06 17:14:16 +01:00
ArrayList<ITxAttribute> attributes = new ArrayList<ITxAttribute>()
2012-06-17 19:53:05 +02:00
2015-01-01 23:17:32 +01:00
def incomingRelations =[]
def outgoingRelations =[]
2015-01-20 18:50:15 +01:00
Tx(int id, TxStream stream, TxGenerator generator, Long begin){
2012-06-17 19:53:05 +02:00
this.id=id
2015-01-09 09:16:40 +01:00
this.stream=stream
2012-06-17 19:53:05 +02:00
this.generator=generator
this.beginTime=begin
}
@Override
2015-01-06 17:14:16 +01:00
public Collection<ITxRelation> getIncomingRelations() {
2015-01-01 23:17:32 +01:00
return incomingRelations;
2012-06-17 19:53:05 +02:00
}
@Override
2015-01-06 17:14:16 +01:00
public Collection<ITxRelation> getOutgoingRelations() {
2015-01-01 23:17:32 +01:00
return outgoingRelations;
2012-06-17 19:53:05 +02:00
}
2015-01-09 09:16:40 +01:00
@Override
public int compareTo(ITx o) {
def res =beginTime.compareTo(o.beginTime)
if(res!=0)
return res
else
return id.compareTo(o.id)
2015-01-09 09:16:40 +01:00
}
2015-01-01 23:17:32 +01:00
2012-06-17 19:53:05 +02:00
}