sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1410843 - in /sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis: internal/util/ util/collection/
Date Sun, 18 Nov 2012 07:24:14 GMT
Author: desruisseaux
Date: Sun Nov 18 07:24:13 2012
New Revision: 1410843

URL: http://svn.apache.org/viewvc?rev=1410843&view=rev
Log:
Trivial variables renaming. The "column indices" term is used by MatLab among others.

Modified:
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ColumnConstant.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/CheckedContainer.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ColumnConstant.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ColumnConstant.java?rev=1410843&r1=1410842&r2=1410843&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ColumnConstant.java
(original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ColumnConstant.java
Sun Nov 18 07:24:13 2012
@@ -28,14 +28,14 @@ import org.apache.sis.util.collection.Ta
 /**
  * {@link TableColumn} constants used in the SIS library.
  *
- * @param <T> Base type of all values in the column identified by this instance.
+ * @param <V> Base type of all values in the column identified by this instance.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
  * @version 0.3
  * @module
  */
-public final class ColumnConstant<T> implements TableColumn<T>, Serializable
{
+public final class ColumnConstant<V> implements TableColumn<V>, Serializable
{
     /**
      * For cross-version compatibility.
      */
@@ -72,7 +72,7 @@ public final class ColumnConstant<T> imp
     /**
      * Base type of all values in the column identified by this {@code ColumnConstant} instance.
      */
-    private final transient Class<T> type;
+    private final transient Class<V> type;
 
     /**
      * The resource key for the column header.
@@ -86,7 +86,7 @@ public final class ColumnConstant<T> imp
      * @param type Base type of all values in the column identified by this instance.
      * @param resourceKey The resource key for the column header.
      */
-    private ColumnConstant(final String name, final Class<T> type, final int resourceKey)
{
+    private ColumnConstant(final String name, final Class<V> type, final int resourceKey)
{
         this.name        = name;
         this.type        = type;
         this.resourceKey = resourceKey;
@@ -104,7 +104,7 @@ public final class ColumnConstant<T> imp
      * Returns the base type of all values in any column identified by this {@code TableConstant}.
      */
     @Override
-    public final Class<T> getElementType() {
+    public final Class<V> getElementType() {
         return type;
     }
 

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/CheckedContainer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/CheckedContainer.java?rev=1410843&r1=1410842&r2=1410843&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/CheckedContainer.java
(original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/CheckedContainer.java
Sun Nov 18 07:24:13 2012
@@ -34,5 +34,5 @@ public interface CheckedContainer<E> {
      *
      * @return The element type.
      */
-    Class<? extends E> getElementType();
+    Class<E> getElementType();
 }

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java?rev=1410843&r1=1410842&r2=1410843&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
(original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
Sun Nov 18 07:24:13 2012
@@ -79,7 +79,7 @@ public class DefaultTreeTable implements
 
     /**
      * The table columns as an unmodifiable list, or {@code null} if not yet created.
-     * The content of this list is the {@link #columnIndex} keys sorted by their index values.
+     * The content of this list is the {@link #columnIndices} keys sorted by their index
values.
      *
      * @see #getColumns()
      */
@@ -94,15 +94,15 @@ public class DefaultTreeTable implements
      *        We serialize this field because children nodes will typically hold a reference
      *        to that map, and we want to preserve the references tree.}
      *
-     * @see DefaultTreeTable.Node#columnIndex
+     * @see DefaultTreeTable.Node#columnIndices
      */
-    final Map<TableColumn<?>,Integer> columnIndex;
+    final Map<TableColumn<?>,Integer> columnIndices;
 
     /**
      * Creates a new table using the given columns.
      */
-    DefaultTreeTable(final Map<TableColumn<?>,Integer> columnIndex) {
-        this.columnIndex = columnIndex;
+    DefaultTreeTable(final Map<TableColumn<?>,Integer> columnIndices) {
+        this.columnIndices = columnIndices;
     }
 
     /**
@@ -120,7 +120,7 @@ public class DefaultTreeTable implements
             throw new IllegalArgumentException(Errors.format(Errors.Keys.EmptyArgument_1,
"columns"));
         }
         columns = columns.clone();
-        this.columnIndex = createColumnIndex(columns);
+        this.columnIndices = createColumnIndices(columns);
         this.columns = UnmodifiableArrayList.wrap(columns);
     }
 
@@ -133,17 +133,17 @@ public class DefaultTreeTable implements
     public DefaultTreeTable(final Node root) {
         ArgumentChecks.ensureNonNull("root", root);
         this.root = root;
-        columnIndex = root.columnIndex;
+        columnIndices = root.columnIndices;
     }
 
     /**
      * Creates a map of column indices from the given list of columns.
-     * This method is invoked for initializing the {@link #columnIndex} field.
+     * This method is invoked for initializing the {@link #columnIndices} field.
      *
      * @param  columns The list of columns.
      * @return The map of column indices.
      */
-    static Map<TableColumn<?>,Integer> createColumnIndex(final TableColumn<?>[]
columns) {
+    static Map<TableColumn<?>,Integer> createColumnIndices(final TableColumn<?>[]
columns) {
         Map<TableColumn<?>,Integer> map;
         switch (columns.length) {
             case 0:  map = Collections.emptyMap(); break;
@@ -167,8 +167,8 @@ public class DefaultTreeTable implements
      * Returns all columns in the given map, sorted by increasing index value.
      * This method relies on {@link LinkedHashSet} preserving insertion order.
      */
-    static TableColumn<?>[] getColumns(final Map<TableColumn<?>,Integer>
columnIndex) {
-        return columnIndex.keySet().toArray(new TableColumn<?>[columnIndex.size()]);
+    static TableColumn<?>[] getColumns(final Map<TableColumn<?>,Integer>
columnIndices) {
+        return columnIndices.keySet().toArray(new TableColumn<?>[columnIndices.size()]);
     }
 
     /**
@@ -178,7 +178,7 @@ public class DefaultTreeTable implements
     @Override
     public final List<TableColumn<?>> getColumns() {
         if (columns == null) {
-            columns = UnmodifiableArrayList.wrap(getColumns(columnIndex));
+            columns = UnmodifiableArrayList.wrap(getColumns(columnIndices));
         }
         return columns;
     }
@@ -209,8 +209,8 @@ public class DefaultTreeTable implements
     public void setRoot(final TreeTable.Node root) {
         ArgumentChecks.ensureNonNull("root", root);
         if (root instanceof Node) {
-            final Map<TableColumn<?>,Integer> other = ((Node) root).columnIndex;
-            if (other != columnIndex && !columnIndex.keySet().containsAll(other.keySet()))
{
+            final Map<TableColumn<?>,Integer> other = ((Node) root).columnIndices;
+            if (other != columnIndices && !columnIndices.keySet().containsAll(other.keySet()))
{
                 throw new IllegalArgumentException(Errors.format(Errors.Keys.InconsistentTableColumns));
             }
         }
@@ -305,9 +305,9 @@ public class DefaultTreeTable implements
          *
          * <p>This map shall be read-only since many {@code Node} instances may
share it.</p>
          *
-         * @see DefaultTreeTable#columnIndex
+         * @see DefaultTreeTable#columnIndices
          */
-        final Map<TableColumn<?>,Integer> columnIndex;
+        final Map<TableColumn<?>,Integer> columnIndices;
 
         /**
          * The values, or {@code null} if not yet created.
@@ -328,10 +328,10 @@ public class DefaultTreeTable implements
             ArgumentChecks.ensureNonNull("table", table);
             if (table instanceof DefaultTreeTable) {
                 // Share the same instance if possible.
-                columnIndex = ((DefaultTreeTable) table).columnIndex;
+                columnIndices = ((DefaultTreeTable) table).columnIndices;
             } else {
                 final List<TableColumn<?>> columns = table.getColumns();
-                columnIndex = createColumnIndex(columns.toArray(new TableColumn<?>[columns.size()]));
+                columnIndices = createColumnIndices(columns.toArray(new TableColumn<?>[columns.size()]));
             }
         }
 
@@ -347,7 +347,7 @@ public class DefaultTreeTable implements
         public Node(final Node parent, int index) {
             ArgumentChecks.ensureNonNull("parent", parent);
             this.parent = parent;
-            columnIndex = parent.columnIndex;
+            columnIndices = parent.columnIndices;
             final TreeNodeList addTo = (TreeNodeList) parent.getChildren();
             if (index < 0) {
                 index = addTo.size();
@@ -371,8 +371,8 @@ public class DefaultTreeTable implements
          */
         final void setParent(final TreeTable.Node node) {
             if (node instanceof Node) {
-                final Map<TableColumn<?>,Integer> other = ((Node) node).columnIndex;
-                if (other != columnIndex && !other.keySet().containsAll(columnIndex.keySet()))
{
+                final Map<TableColumn<?>,Integer> other = ((Node) node).columnIndices;
+                if (other != columnIndices && !other.keySet().containsAll(columnIndices.keySet()))
{
                     throw new IllegalArgumentException(Errors.format(Errors.Keys.InconsistentTableColumns));
                 }
             }
@@ -399,15 +399,15 @@ public class DefaultTreeTable implements
         /**
          * Returns the value in the given column, or {@code null} if none.
          *
-         * @param  <T>    The base type of values in the given column.
+         * @param  <V>    The base type of values in the given column.
          * @param  column Identifier of the column from which to get the value.
          * @return The value in the given column, or {@code null} if none.
          */
         @Override
-        public <T> T getValue(final TableColumn<T> column) {
+        public <V> V getValue(final TableColumn<V> column) {
             ArgumentChecks.ensureNonNull("column", column);
             if (values != null) {
-                final Integer index = columnIndex.get(column);
+                final Integer index = columnIndices.get(column);
                 if (index != null) {
                     return column.getElementType().cast(values[index]);
                 }
@@ -420,7 +420,7 @@ public class DefaultTreeTable implements
          * The {@link #isEditable(TableColumn)} method can be invoked before this setter
method
          * for determining if the given column is modifiable.
          *
-         * @param  <T>    The base type of values in the given column.
+         * @param  <V>    The base type of values in the given column.
          * @param  column Identifier of the column into which to set the value.
          * @param  value  The value to set.
          * @throws IllegalArgumentException If the given column is not a legal column for
this node.
@@ -428,16 +428,16 @@ public class DefaultTreeTable implements
          * @see #isEditable(TableColumn)
          */
         @Override
-        public <T> void setValue(final TableColumn<T> column, final T value)
{
+        public <V> void setValue(final TableColumn<V> column, final V value)
{
             ArgumentChecks.ensureNonNull("column", column);
-            final Integer index = columnIndex.get(column);
+            final Integer index = columnIndices.get(column);
             if (index == null) {
                 throw new IllegalArgumentException(Errors.format(
                         Errors.Keys.IllegalArgumentValue_2, "column", column));
             }
             if (values == null) {
                 if (value == null) return;
-                values = new Object[columnIndex.size()];
+                values = new Object[columnIndices.size()];
             }
             values[index] = value;
         }
@@ -448,7 +448,7 @@ public class DefaultTreeTable implements
         @Override
         public boolean isEditable(final TableColumn<?> column) {
             ArgumentChecks.ensureNonNull("column", column);
-            return columnIndex.containsKey(column);
+            return columnIndices.containsKey(column);
         }
 
         /**

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java?rev=1410843&r1=1410842&r2=1410843&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java
(original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java
Sun Nov 18 07:24:13 2012
@@ -238,7 +238,7 @@ class DerivedSet<S,E> extends AbstractSe
          */
         @Override
         public final boolean contains(final Object element) {
-            final Class<? extends E> type = getElementType();
+            final Class<E> type = getElementType();
             return type.isInstance(element) && storage.contains(inverse.convert(type.cast(element)));
         }
 
@@ -258,7 +258,7 @@ class DerivedSet<S,E> extends AbstractSe
          */
         @Override
         public final boolean remove(final Object element) throws UnsupportedOperationException
{
-            final Class<? extends E> type = getElementType();
+            final Class<E> type = getElementType();
             return type.isInstance(element) && storage.remove(inverse.convert(type.cast(element)));
         }
     }

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java?rev=1410843&r1=1410842&r2=1410843&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
(original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
Sun Nov 18 07:24:13 2012
@@ -43,14 +43,14 @@ import org.opengis.util.InternationalStr
  *     }
  * }
  *
- * @param <T> Base type of all values in the column identified by this instance.
+ * @param <V> Base type of all values in the column identified by this instance.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
  * @version 0.3
  * @module
  */
-public interface TableColumn<T> extends CheckedContainer<T> {
+public interface TableColumn<V> extends CheckedContainer<V> {
     /**
      * Returns the text to display as column header.
      *
@@ -63,5 +63,5 @@ public interface TableColumn<T> extends 
      * instance.
      */
     @Override
-    Class<T> getElementType();
+    Class<V> getElementType();
 }

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java?rev=1410843&r1=1410842&r2=1410843&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
(original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
Sun Nov 18 07:24:13 2012
@@ -102,21 +102,21 @@ public interface TreeTable {
         /**
          * Returns the value in the given column, or {@code null} if none.
          *
-         * @param  <T>    The base type of values in the given column.
+         * @param  <V>    The base type of values in the given column.
          * @param  column Identifier of the column from which to get the value.
          * @return The value in the given column, or {@code null} if none.
          *
          * @see TreeTable#getColumns()
          * @category table
          */
-        <T> T getValue(TableColumn<T> column);
+        <V> V getValue(TableColumn<V> column);
 
         /**
          * Sets the value for the given column (optional operation).
          * The {@link #isEditable(TableColumn)} method can be invoked before this setter
method
          * for determining if the given column is modifiable.
          *
-         * @param  <T>    The base type of values in the given column.
+         * @param  <V>    The base type of values in the given column.
          * @param  column Identifier of the column into which to set the value.
          * @param  value  The value to set.
          * @throws IllegalArgumentException If the given column is not a legal column for
this node.
@@ -126,7 +126,7 @@ public interface TreeTable {
          * @see #isEditable(TableColumn)
          * @category table
          */
-        <T> void setValue(TableColumn<T> column, T value);
+        <V> void setValue(TableColumn<V> column, V value);
 
         /**
          * Determines whether the value in the specified column is editable. If the given



Mime
View raw message