sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 02/04: Rename Node.name() as getName() in order to implement Function.getName().
Date Thu, 15 Aug 2019 15:41:23 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit be6e5d5200b5e775d6922e2039e1b900b13b206b
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Wed Aug 14 13:32:48 2019 +0200

    Rename Node.name() as getName() in order to implement Function.getName().
---
 .../org/apache/sis/filter/AbstractFunction.java    |  5 -----
 .../org/apache/sis/filter/ArithmeticFunction.java  | 16 +++++++--------
 .../org/apache/sis/filter/ComparisonFunction.java  | 24 +++++++++++-----------
 .../org/apache/sis/filter/FilterByIdentifier.java  |  2 +-
 .../java/org/apache/sis/filter/LeafExpression.java |  4 ++--
 .../org/apache/sis/filter/LogicalFunction.java     |  8 ++++----
 .../src/main/java/org/apache/sis/filter/Node.java  |  8 ++++----
 .../java/org/apache/sis/filter/UnaryFunction.java  |  8 ++++----
 8 files changed, 35 insertions(+), 40 deletions(-)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/filter/AbstractFunction.java b/core/sis-feature/src/main/java/org/apache/sis/filter/AbstractFunction.java
index 219b76d..4620ceb 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/filter/AbstractFunction.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/filter/AbstractFunction.java
@@ -49,11 +49,6 @@ abstract class AbstractFunction extends Node implements Function {
     }
 
     @Override
-    protected String name() {
-        return name;
-    }
-
-    @Override
     protected Collection<?> getChildren() {
         return parameters;
     }
diff --git a/core/sis-feature/src/main/java/org/apache/sis/filter/ArithmeticFunction.java
b/core/sis-feature/src/main/java/org/apache/sis/filter/ArithmeticFunction.java
index ebacd88..fdda3dc 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/filter/ArithmeticFunction.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/filter/ArithmeticFunction.java
@@ -131,8 +131,8 @@ abstract class ArithmeticFunction extends BinaryFunction implements BinaryExpres
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '+';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '+';}
 
         /** Applies this expression to the given operands. */
         @Override protected Number applyAsDouble  (double     left, double     right) {return
left + right;}
@@ -165,8 +165,8 @@ abstract class ArithmeticFunction extends BinaryFunction implements BinaryExpres
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '−';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '−';}
 
         /** Applies this expression to the given operands. */
         @Override protected Number applyAsDouble  (double     left, double     right) {return
left - right;}
@@ -199,8 +199,8 @@ abstract class ArithmeticFunction extends BinaryFunction implements BinaryExpres
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '×';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '×';}
 
         /** Applies this expression to the given operands. */
         @Override protected Number applyAsDouble  (double     left, double     right) {return
left * right;}
@@ -233,8 +233,8 @@ abstract class ArithmeticFunction extends BinaryFunction implements BinaryExpres
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '÷';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '÷';}
 
         /** Applies this expression to the given operands. */
         @Override protected Number applyAsDouble  (double     left, double     right) {return
left / right;}
diff --git a/core/sis-feature/src/main/java/org/apache/sis/filter/ComparisonFunction.java
b/core/sis-feature/src/main/java/org/apache/sis/filter/ComparisonFunction.java
index 2658729..179dc3e 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/filter/ComparisonFunction.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/filter/ComparisonFunction.java
@@ -326,8 +326,8 @@ abstract class ComparisonFunction extends BinaryFunction implements BinaryCompar
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '<';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '<';}
 
         /** Converts {@link Comparable#compareTo(Object)} result to this filter result. */
         @Override protected boolean fromCompareTo(final int result) {return result < 0;}
@@ -360,8 +360,8 @@ abstract class ComparisonFunction extends BinaryFunction implements BinaryCompar
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '≤';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '≤';}
 
         /** Converts {@link Comparable#compareTo(Object)} result to this filter result. */
         @Override protected boolean fromCompareTo(final int result) {return result <=
0;}
@@ -392,8 +392,8 @@ abstract class ComparisonFunction extends BinaryFunction implements BinaryCompar
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '>';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '>';}
 
         /** Converts {@link Comparable#compareTo(Object)} result to this filter result. */
         @Override protected boolean fromCompareTo(final int result) {return result > 0;}
@@ -426,8 +426,8 @@ abstract class ComparisonFunction extends BinaryFunction implements BinaryCompar
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '≥';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '≥';}
 
         /** Converts {@link Comparable#compareTo(Object)} result to this filter result. */
         @Override protected boolean fromCompareTo(final int result) {return result >=
0;}
@@ -458,8 +458,8 @@ abstract class ComparisonFunction extends BinaryFunction implements BinaryCompar
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '=';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '=';}
 
         /** Converts {@link Comparable#compareTo(Object)} result to this filter result. */
         @Override protected boolean fromCompareTo(final int result) {return result == 0;}
@@ -490,8 +490,8 @@ abstract class ComparisonFunction extends BinaryFunction implements BinaryCompar
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '≠';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '≠';}
 
         /** Converts {@link Comparable#compareTo(Object)} result to this filter result. */
         @Override protected boolean fromCompareTo(final int result) {return result != 0;}
diff --git a/core/sis-feature/src/main/java/org/apache/sis/filter/FilterByIdentifier.java
b/core/sis-feature/src/main/java/org/apache/sis/filter/FilterByIdentifier.java
index 2ba3a83..f8f34df 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/filter/FilterByIdentifier.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/filter/FilterByIdentifier.java
@@ -69,7 +69,7 @@ final class FilterByIdentifier extends Node implements Id {
      * Returns a name identifying this kind of filter.
      */
     @Override
-    protected String name() {
+    protected String getName() {
         return "Id";
     }
 
diff --git a/core/sis-feature/src/main/java/org/apache/sis/filter/LeafExpression.java b/core/sis-feature/src/main/java/org/apache/sis/filter/LeafExpression.java
index 84027cf..7b90b5a 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/filter/LeafExpression.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/filter/LeafExpression.java
@@ -107,7 +107,7 @@ abstract class LeafExpression extends Node implements Expression, FeatureExpress
         }
 
         /** Identification of this expression. */
-        @Override protected String name() {
+        @Override protected String getName() {
             return "PropertyName";
         }
 
@@ -194,7 +194,7 @@ abstract class LeafExpression extends Node implements Expression, FeatureExpress
         }
 
         /** Identification of this expression. */
-        @Override protected String name() {
+        @Override protected String getName() {
             return "Literal";
         }
 
diff --git a/core/sis-feature/src/main/java/org/apache/sis/filter/LogicalFunction.java b/core/sis-feature/src/main/java/org/apache/sis/filter/LogicalFunction.java
index bdac096..e0b5745 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/filter/LogicalFunction.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/filter/LogicalFunction.java
@@ -104,8 +104,8 @@ abstract class LogicalFunction extends Node {
         }
 
         /** Returns a name for this filter. */
-        @Override protected String name() {return "And";}
-        @Override protected char symbol() {return filters.length <= 2 ? '∧' : '⋀';}
+        @Override protected String getName() {return "And";}
+        @Override protected char   symbol()  {return filters.length <= 2 ? '∧' : '⋀';}
 
         /** Implementation of the visitor pattern. */
         @Override public Object accept(FilterVisitor visitor, Object extraData) {
@@ -137,8 +137,8 @@ abstract class LogicalFunction extends Node {
         }
 
         /** Returns a name for this filter. */
-        @Override protected String name() {return "Or";}
-        @Override protected char symbol() {return filters.length <= 2 ? '∨' : '⋁';}
+        @Override protected String getName() {return "Or";}
+        @Override protected char   symbol()  {return filters.length <= 2 ? '∨' : '⋁';}
 
         /** Implementation of the visitor pattern. */
         @Override public Object accept(FilterVisitor visitor, Object extraData) {
diff --git a/core/sis-feature/src/main/java/org/apache/sis/filter/Node.java b/core/sis-feature/src/main/java/org/apache/sis/filter/Node.java
index 1b9d552..72f1122 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/filter/Node.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/filter/Node.java
@@ -87,7 +87,7 @@ abstract class Node implements Serializable {
      *
      * @return the name of this node.
      */
-    protected abstract String name();
+    protected abstract String getName();
 
     /**
      * Returns the children of this node, or an empty collection if none. This is used for
@@ -101,15 +101,15 @@ abstract class Node implements Serializable {
     protected abstract Collection<?> getChildren();
 
     /**
-     * Builds a tree representation of this node, including all children. This method expects
-     * an initially empty node, which will be set to the {@linkplain #name()} of this node.
+     * Builds a tree representation of this node, including all children. This method expects
an
+     * initially empty node, which will be set to the {@linkplain #getName() name} of this
node.
      * Then all children will be appended recursively, with a check against cyclic graph.
      *
      * @param  root     where to create a tree representation of this node.
      * @param  visited  nodes already visited. This method will write in this map.
      */
     private void toTree(final TreeTable.Node root, final Map<Object,Boolean> visited)
{
-        root.setValue(TableColumn.VALUE, name());
+        root.setValue(TableColumn.VALUE, getName());
         for (final Object child : getChildren()) {
             final TreeTable.Node node = root.newChild();
             final String value;
diff --git a/core/sis-feature/src/main/java/org/apache/sis/filter/UnaryFunction.java b/core/sis-feature/src/main/java/org/apache/sis/filter/UnaryFunction.java
index 84bb74f..f506918 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/filter/UnaryFunction.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/filter/UnaryFunction.java
@@ -112,8 +112,8 @@ abstract class UnaryFunction extends Node implements Serializable {
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return NAME;}
-        @Override protected char symbol() {return '∅';}
+        @Override protected String getName() {return NAME;}
+        @Override protected char   symbol()  {return '∅';}
 
         /** Returns {@code true} if the given value evaluates to {@code null}. */
         @Override public boolean evaluate(final Object object) {
@@ -144,8 +144,8 @@ abstract class UnaryFunction extends Node implements Serializable {
         }
 
         /** Identification of this operation. */
-        @Override protected String name() {return "Not";}
-        @Override protected char symbol() {return '¬';}
+        @Override protected String getName() {return "Not";}
+        @Override protected char   symbol()  {return '¬';}
 
         /** Returns the singleton filter used by this operation. */
         @Override protected Collection<Filter> getChildren() {


Mime
View raw message