Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/event/LttngLocation.java')
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/event/LttngLocation.java165
1 files changed, 0 insertions, 165 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/event/LttngLocation.java b/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/event/LttngLocation.java
deleted file mode 100644
index 8869483b72..0000000000
--- a/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/event/LttngLocation.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.eclipse.linuxtools.internal.lttng.core.event;
-
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
-
-
-public class LttngLocation implements ITmfLocation<LttngTimestamp>, Comparable<LttngLocation>, Cloneable {
-
- private final static long DEFAULT_CURR_TIME = 0L;
-
- private boolean isLastOperationParse = false ;
- private boolean isLastOperationReadNext = false;
- private boolean isLastOperationSeek = false;
-
- private LttngTimestamp operationTime = null;
-
- public LttngLocation() {
- this( DEFAULT_CURR_TIME );
- }
-
- public LttngLocation(final long newCurrentTimestampValue) {
- isLastOperationParse = false;
- isLastOperationReadNext = false;
- isLastOperationSeek = false;
- operationTime = new LttngTimestamp(newCurrentTimestampValue);
- }
-
- public LttngLocation(final LttngTimestamp newCurrentTimestamp) {
- isLastOperationParse = false;
- isLastOperationReadNext = false;
- isLastOperationSeek = false;
- operationTime = new LttngTimestamp(newCurrentTimestamp);
- }
-
-
- public LttngLocation(final LttngLocation oldLocation) {
- this.isLastOperationParse = oldLocation.isLastOperationParse;
- this.isLastOperationReadNext = oldLocation.isLastOperationReadNext;
- this.isLastOperationSeek = oldLocation.isLastOperationSeek;
- this.operationTime = oldLocation.operationTime.clone();
- }
-
- @Override
- public LttngLocation clone() {
- LttngLocation newLocation = new LttngLocation(this);
- newLocation.operationTime = new LttngTimestamp( this.operationTime );
- return newLocation;
- }
-
- public LttngTimestamp getOperationTime() {
- return operationTime;
- }
-
- public long getOperationTimeValue() {
- return operationTime.getValue();
- }
-
- public void setOperationTime(final LttngTimestamp newOperationTime) {
- this.operationTime.setValue(newOperationTime.getValue());
- }
-
- public void setOperationTime(final Long newOperationTimeValue) {
- this.operationTime.setValue(newOperationTimeValue);
- }
-
-
- public void setLastOperationParse() {
- isLastOperationParse = true;
- isLastOperationReadNext = false;
- isLastOperationSeek = false;
- }
-
- public boolean isLastOperationParse() {
- return isLastOperationParse;
- }
-
-
- public void setLastOperationReadNext() {
- isLastOperationParse = false;
- isLastOperationReadNext = true;
- isLastOperationSeek = false;
- }
-
- public boolean isLastOperationReadNext() {
- return isLastOperationReadNext;
- }
-
-
- public void setLastOperationSeek() {
- isLastOperationParse = false;
- isLastOperationReadNext = false;
- isLastOperationSeek = true;
- }
-
- public boolean isLastOperationSeek() {
- return isLastOperationSeek;
- }
-
- public void resetLocationState() {
- isLastOperationParse = false;
- isLastOperationReadNext = false;
- isLastOperationSeek = false;
- }
-
- // ------------------------------------------------------------------------
- // Object
- // ------------------------------------------------------------------------
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (isLastOperationParse ? 1231 : 1237);
- result = prime * result + (isLastOperationReadNext ? 1231 : 1237);
- result = prime * result + (isLastOperationSeek ? 1231 : 1237);
- result = prime * result + ((operationTime == null) ? 0 : operationTime.hashCode());
- return result;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof LttngLocation))
- return false;
- final LttngLocation o = (LttngLocation) obj;
- return (operationTime.equals(o.operationTime))
- && (isLastOperationParse == o.isLastOperationParse)
- && (isLastOperationReadNext == o.isLastOperationReadNext)
- && (isLastOperationSeek == o.isLastOperationSeek);
- }
-
- @Override
- public String toString() {
- // return "\tLttngLocation[ P/R/S : " + isLastOperationParse + "/" + isLastOperationReadNext + "/" + isLastOperationSeek + " Current : " + operationTime + " ]";
- return operationTime.toString();
- }
-
- // ------------------------------------------------------------------------
- // ITmfLocation
- // ------------------------------------------------------------------------
-
- // @Override
- public void setLocation(final LttngTimestamp location) {
- operationTime = location;
- }
-
- @Override
- public LttngTimestamp getLocation() {
- return new LttngTimestamp ( operationTime );
- }
-
- @Override
- public int compareTo(final LttngLocation o) {
- return operationTime.compareTo(o.operationTime);
- }
-
-}

Back to the top