summaryrefslogtreecommitdiff
path: root/sources/core/time
diff options
context:
space:
mode:
authorPaul Buetow (centauri) <puppet@mx.buetow.org>2015-05-23 21:59:43 +0100
committerPaul Buetow (centauri) <puppet@mx.buetow.org>2015-05-23 21:59:43 +0100
commit9fc2fc3ccdedf1b7e48f8dfb618ca6cb6a2a662e (patch)
tree0fa92fe4e75cb53ffbf7eb56b5455eb9457bb06c /sources/core/time
parentf7873669a43421331e14b8921ebdaa8af4393bd5 (diff)
parent32749241efc1f5f70056d74a90237388f57ea350 (diff)
Merge remote-tracking branch 'remotes/github/packages' into packagespackages
Diffstat (limited to 'sources/core/time')
-rw-r--r--sources/core/time/VSLamportTime.java76
-rw-r--r--sources/core/time/VSTime.java45
-rw-r--r--sources/core/time/VSVectorTime.java119
3 files changed, 0 insertions, 240 deletions
diff --git a/sources/core/time/VSLamportTime.java b/sources/core/time/VSLamportTime.java
deleted file mode 100644
index 165adfc..0000000
--- a/sources/core/time/VSLamportTime.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package core.time;
-
-/**
- * The class VSLamportTime, defines how the lamport timestamps are represented.
- *
- * @author Paul C. Buetow
- */
-public class VSLamportTime implements VSTime {
- /** The serial version uid */
- private static final long serialVersionUID = 1L;
-
- /** Specified the global time of the lamport timestamp. It's used for
- * correct painting position in the simulator canvas paint area.
- */
- private long globalTime;
-
- /** Specified the process' local lamport time. */
- private long lamportTime;
-
- /**
- * A simple constructor.
- *
- * @param globalTime The global time.
- * @param lamportTime The local lamport time.
- */
- public VSLamportTime(long globalTime, long lamportTime) {
- this.globalTime = globalTime;
- this.lamportTime = lamportTime;
- }
-
- /* (non-Javadoc)
- * @see core.time.VSTime#getGlobalTime()
- */
- public long getGlobalTime() {
- return globalTime;
- }
-
- /**
- * Gets the lamport time.
- *
- * @return The process' local lamport time
- */
- public long getLamportTime() {
- return lamportTime;
- }
-
- /* (non-Javadoc)
- * @see core.time.VSTime#toString()
- */
- public String toString() {
- return "(" + lamportTime + ")";
- }
-}
diff --git a/sources/core/time/VSTime.java b/sources/core/time/VSTime.java
deleted file mode 100644
index 3142d6b..0000000
--- a/sources/core/time/VSTime.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package core.time;
-
-/**
- * This interface is a guidline for general time format classes.
- *
- * @author Paul C. Buetow
- */
-public interface VSTime {
- /**
- * Gets the global time.
- *
- * @return The global time
- */
- public long getGlobalTime();
-
- /**
- * Returns a string representation.
- *
- * @return The representation of the implementing object as a string
- */
- public String toString();
-}
diff --git a/sources/core/time/VSVectorTime.java b/sources/core/time/VSVectorTime.java
deleted file mode 100644
index ebd5438..0000000
--- a/sources/core/time/VSVectorTime.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package core.time;
-
-import java.util.ArrayList;
-
-/**
- * The class VSVectorTime, defined how the vector timestamps are represented.
- *
- * @author Paul C. Buetow
- */
-public class VSVectorTime extends ArrayList<Long> implements VSTime {
- /** The serial version uid */
- private static final long serialVersionUID = 1L;
-
- /** The global time. */
- private long globalTime;
-
- /**
- * Instantiates a new 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];
-
- for (int i = 0; i < size; ++i)
- arr[i] = super.get(i).longValue();
-
- 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();
-
- for (int i = 0; i < size; ++i)
- vectorTime.add(super.get(i));
-
- return vectorTime;
- }
-
- /* (non-Javadoc)
- * @see java.util.AbstractCollection#toString()
- */
- public String toString() {
- final int size = super.size();
- final StringBuffer buffer = new StringBuffer();
- buffer.append("(");
-
- for (int i = 0; i < size-1; ++i)
- buffer.append(super.get(i)+",");
- buffer.append(super.get(size-1)+")");
-
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see java.util.ArrayList#get(int)
- */
- public Long get(int index) {
- if (index >= super.size())
- return new Long(0);
-
- return super.get(index);
- }
-}