Initial version
This commit is contained in:
7
com.itjw.txviewer.database/.classpath
Normal file
7
com.itjw.txviewer.database/.classpath
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
com.itjw.txviewer.database/.project
Normal file
28
com.itjw.txviewer.database/.project
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.itjw.txviewer.database</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@@ -0,0 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
@@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
pluginProject.extensions=false
|
||||
resolve.requirebundle=false
|
10
com.itjw.txviewer.database/META-INF/MANIFEST.MF
Normal file
10
com.itjw.txviewer.database/META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1,10 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Transaction Database
|
||||
Bundle-SymbolicName: com.itjw.txviewer.database
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: ITJW
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.itjw.txviewer.database
|
||||
Require-Bundle: org.eclipse.ui.views
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4
com.itjw.txviewer.database/build.properties
Normal file
4
com.itjw.txviewer.database/build.properties
Normal file
@@ -0,0 +1,4 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
@@ -0,0 +1,57 @@
|
||||
package com.itjw.txviewer.database;
|
||||
|
||||
public class EventTime implements Comparable<EventTime>{
|
||||
public static final double NS = 1000000.0;
|
||||
public static final double MS = 1000000000.0;
|
||||
private long value; // unit is femto seconds
|
||||
|
||||
public EventTime(Long value, String unit){
|
||||
setValue(value, unit);
|
||||
}
|
||||
|
||||
public long getValue(){
|
||||
return(value);
|
||||
}
|
||||
|
||||
public double getScaledValue(double scale){
|
||||
return value/scale;
|
||||
}
|
||||
|
||||
public double getValueNS(){
|
||||
return getScaledValue(NS);
|
||||
}
|
||||
|
||||
public double getValueMS(){
|
||||
return getScaledValue(MS);
|
||||
}
|
||||
|
||||
public void setValue(long value){
|
||||
this.value=value;
|
||||
}
|
||||
|
||||
public void setValue(long value, String unit){
|
||||
this.value=value;
|
||||
if("fs".compareToIgnoreCase(unit)==0)
|
||||
this.value=value;
|
||||
else if("ps".compareToIgnoreCase(unit)==0)
|
||||
this.value=value*1000;
|
||||
else if("ns".compareToIgnoreCase(unit)==0)
|
||||
this.value=value*1000000;
|
||||
else if("us".compareToIgnoreCase(unit)==0)
|
||||
this.value=value*1000000000;
|
||||
else if("ms".compareToIgnoreCase(unit)==0)
|
||||
this.value=value*1000000000000L;
|
||||
else {
|
||||
System.err.print("Don't know what to do with "+unit+"\n");
|
||||
}
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return value/1000000 +"ns";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(EventTime other) {
|
||||
return this.value<other.value? -1 : this.value==other.value? 0 : 1;
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.itjw.txviewer.database;
|
||||
|
||||
public interface ITrAttrType {
|
||||
public String getName();
|
||||
public String getType();
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.itjw.txviewer.database;
|
||||
|
||||
public interface ITrAttribute extends ITrAttrType {
|
||||
public Object getValue();
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.itjw.txviewer.database;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface ITrDb extends ITrHierNode {
|
||||
|
||||
public EventTime getMaxTime();
|
||||
|
||||
public List<ITrStream> getAllStreams();
|
||||
|
||||
public void load(InputStream inp) throws InputFormatException;
|
||||
|
||||
public void clear();
|
||||
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.itjw.txviewer.database;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ITrGenerator {
|
||||
public Long getId();
|
||||
public ITrStream getStream();
|
||||
public String getName();
|
||||
// public Boolean isActive();
|
||||
public List<ITransaction> getTransactions();
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
package com.itjw.txviewer.database;
|
||||
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.List;
|
||||
|
||||
public interface ITrHierNode {
|
||||
/**
|
||||
* Attach a non-null PropertyChangeListener to this object.
|
||||
*
|
||||
* @param l
|
||||
* a non-null PropertyChangeListener instance
|
||||
* @throws IllegalArgumentException
|
||||
* if the parameter is null
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l);
|
||||
/**
|
||||
* Remove a PropertyChangeListener from this component.
|
||||
*
|
||||
* @param l
|
||||
* a PropertyChangeListener instance
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) ;
|
||||
|
||||
public String getFullName();
|
||||
|
||||
public String getName();
|
||||
|
||||
public void setName(String name);
|
||||
|
||||
public List<ITrHierNode> getChildNodes();
|
||||
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
package com.itjw.txviewer.database;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ITrStream extends ITrHierNode {
|
||||
|
||||
public Long getId();
|
||||
|
||||
public String getKind();
|
||||
|
||||
public ITrDb getDb();
|
||||
|
||||
public List<ITrGenerator> getGenerators();
|
||||
|
||||
public List<ITransaction> getTransactions();
|
||||
|
||||
public int getMaxConcurrrentTx();
|
||||
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package com.itjw.txviewer.database;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public interface ITransaction {
|
||||
public Long getId();
|
||||
public ITrGenerator getGenerator();
|
||||
public EventTime getBeginTime();
|
||||
public EventTime getEndTime();
|
||||
public List<ITrAttribute> getBeginAttrs();
|
||||
public List<ITrAttribute> getEndAttrs();
|
||||
public List<ITrAttribute> getAttributes();
|
||||
public Set<ITransaction> getNextInRelationship(RelationType rel);
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.itjw.txviewer.database;
|
||||
|
||||
public class InputFormatException extends Exception {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8676129878197783368L;
|
||||
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.itjw.txviewer.database;
|
||||
|
||||
public enum RelationType {
|
||||
PREDECESSOR, SUCCESSOR, PREVIOUS, NEXT, PARENT, CHILD;
|
||||
}
|
Reference in New Issue
Block a user