summaryrefslogtreecommitdiff
path: root/sources/core/time/VSVectorTime.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/core/time/VSVectorTime.java')
-rw-r--r--sources/core/time/VSVectorTime.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/sources/core/time/VSVectorTime.java b/sources/core/time/VSVectorTime.java
index eb6c0aa..647eb7a 100644
--- a/sources/core/time/VSVectorTime.java
+++ b/sources/core/time/VSVectorTime.java
@@ -1,14 +1,34 @@
+/*
+ * VS is (c) 2008 by Paul C. Buetow
+ * vs@dev.buetow.org
+ */
package core.time;
import java.util.ArrayList;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class VSVectorTime.
+ */
public class VSVectorTime extends ArrayList<Long> implements VSTime {
+
+ /** The global time. */
private long globalTime;
+ /**
+ * Instantiates a new vS vector time.
+ *
+ * @param globalTime the global time
+ */
public VSVectorTime(long globalTime) {
this.globalTime = globalTime;
}
+ /**
+ * To long array.
+ *
+ * @return the long[]
+ */
public long[] toLongArray() {
final int size = super.size();
final long[] arr = new long[size];
@@ -19,14 +39,27 @@ public class VSVectorTime extends ArrayList<Long> implements VSTime {
return arr;
}
+ /**
+ * Sets the global time.
+ *
+ * @param globalTime the new global time
+ */
public void setGlobalTime(long globalTime) {
this.globalTime = globalTime;
}
+ /* (non-Javadoc)
+ * @see core.time.VSTime#getGlobalTime()
+ */
public long getGlobalTime() {
return globalTime;
}
+ /**
+ * Gets the copy.
+ *
+ * @return the copy
+ */
public VSVectorTime getCopy() {
final VSVectorTime vectorTime = new VSVectorTime(globalTime);
final int size = super.size();
@@ -37,6 +70,9 @@ public class VSVectorTime extends ArrayList<Long> implements VSTime {
return vectorTime;
}
+ /* (non-Javadoc)
+ * @see java.util.AbstractCollection#toString()
+ */
public String toString() {
final int size = super.size();
final StringBuffer buffer = new StringBuffer();
@@ -49,6 +85,9 @@ public class VSVectorTime extends ArrayList<Long> implements VSTime {
return buffer.toString();
}
+ /* (non-Javadoc)
+ * @see java.util.ArrayList#get(int)
+ */
public Long get(int index) {
if (index >= super.size())
return new Long(0);