SCViewer/com.itjw.txviewer.database..../src/com/itjw/txviewer/database/text/Transaction.groovy

94 lines
1.8 KiB
Groovy
Raw Normal View History

2012-06-17 19:53:05 +02:00
package com.itjw.txviewer.database.text
import java.util.Set
import com.itjw.txviewer.database.*
import org.eclipse.ui.views.properties.IPropertyDescriptor
import org.eclipse.ui.views.properties.IPropertySource
class Transaction implements IPropertySource, ITransaction {
Long id
TrGenerator generator
EventTime beginTime
EventTime endTime
ArrayList<ITrAttribute> begin_attrs = new ArrayList<ITrAttribute>()
ArrayList<ITrAttribute> end_attrs = new ArrayList<ITrAttribute>()
ArrayList<ITrAttribute> attributes = new ArrayList<ITrAttribute>()
Transaction prev, next
def pred =[]
def succ =[]
def parent =[]
def child =[]
Transaction(int id, TrGenerator generator, EventTime begin){
this.id=id
this.generator=generator
this.beginTime=begin
}
@Override
List<ITrAttribute> getBeginAttrs() {
return begin_attrs
}
@Override
List<ITrAttribute> getEndAttrs() {
return end_attrs
}
List<ITrAttribute> getAttributes(){
return attributes
}
@Override
public Set<ITransaction> getNextInRelationship(RelationType rel) {
switch(rel){
case RelationType.PREDECESSOR:
return pred
break
case RelationType.SUCCESSOR:
return succ
break
case RelationType.PREVIOUS:
return [prev]
break
case RelationType.NEXT:
return[next]
break
case RelationType.PARENT:
return parent
break
case RelationType.CHILD:
return child
break
}
}
@Override
public Object getEditableValue() {
// TODO Auto-generated method stub
return null;
}
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
return null;
}
@Override
public Object getPropertyValue(Object id) {
return null;
}
@Override
public boolean isPropertySet(Object id) {
return false;
}
@Override
public void resetPropertyValue(Object id) {
}
@Override
public void setPropertyValue(Object id, Object value) {
}
}