aboutsummaryrefslogtreecommitdiff
path: root/project/JavaCommon/src/com/modulus/common/collections/Grid.java
diff options
context:
space:
mode:
Diffstat (limited to 'project/JavaCommon/src/com/modulus/common/collections/Grid.java')
-rw-r--r--project/JavaCommon/src/com/modulus/common/collections/Grid.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/project/JavaCommon/src/com/modulus/common/collections/Grid.java b/project/JavaCommon/src/com/modulus/common/collections/Grid.java
new file mode 100644
index 0000000..817a36c
--- /dev/null
+++ b/project/JavaCommon/src/com/modulus/common/collections/Grid.java
@@ -0,0 +1,35 @@
+package com.modulus.common.collections;
+
+/**
+ * Interface describing an immutable grid interface.
+ *
+ * @author jrahm
+ *
+ * @param <T> the type of object this grid holds
+ */
+public interface Grid<T> {
+ /**
+ * Returns the object stored in
+ * row <code>row</code> and column
+ * <code>col</code>
+ *
+ * @param row the row of the object
+ * @param col the column of the object
+ * @return the object stored in that row and column
+ */
+ public T get(int row, int col);
+
+ /**
+ * Returns the number of columns in this grid
+ *
+ * @return the number of columns in this grid
+ */
+ public int numberOfColumns();
+
+ /**
+ * Returns the number of columns in this grid.
+ *
+ * @return the number of columns in this grid
+ */
+ public int numberOfRows();
+}