Resolves checkstyle errors for intercepting-filter, interpreter, iterator (#1065)
* Reduces checkstyle errors in intercepting-filter * Reduces checkstyle errors in interpreter * Reduces checkstyle errors in iterator
This commit is contained in:
committed by
Ilkka Seppälä
parent
dda09535e6
commit
7f06f3b78c
@ -23,35 +23,30 @@
|
||||
|
||||
package com.iluwatar.interpreter;
|
||||
|
||||
import java.util.Stack;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Stack;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Interpreter pattern is a design pattern that specifies how to evaluate sentences in a
|
||||
* language. The basic idea is to have a class for each symbol (terminal or nonterminal) in a
|
||||
* specialized computer language. The syntax tree of a sentence in the language is an instance of
|
||||
* the composite pattern and is used to evaluate (interpret) the sentence for a client.
|
||||
* <p>
|
||||
* In this example we use the Interpreter pattern to break sentences into expressions (
|
||||
* {@link Expression}) that can be evaluated and as a whole form the result.
|
||||
*
|
||||
*
|
||||
* <p>In this example we use the Interpreter pattern to break sentences into expressions ({@link
|
||||
* Expression}) that can be evaluated and as a whole form the result.
|
||||
*/
|
||||
public class App {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
|
||||
|
||||
/**
|
||||
*
|
||||
* Program entry point.
|
||||
* <p>
|
||||
* Expressions can be evaluated using prefix, infix or postfix notations This sample uses postfix,
|
||||
* where operator comes after the operands
|
||||
*
|
||||
*
|
||||
* <p>Expressions can be evaluated using prefix, infix or postfix notations This sample uses
|
||||
* postfix, where operator comes after the operands.
|
||||
*
|
||||
* @param args command line args
|
||||
*
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
String tokenString = "4 3 2 - 1 + *";
|
||||
@ -84,7 +79,7 @@ public class App {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get expression for string
|
||||
* Get expression for string.
|
||||
*/
|
||||
public static Expression getOperatorInstance(String s, Expression left, Expression right) {
|
||||
switch (s) {
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.interpreter;
|
||||
|
||||
/**
|
||||
*
|
||||
* Expression
|
||||
*
|
||||
* Expression.
|
||||
*/
|
||||
public abstract class Expression {
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.interpreter;
|
||||
|
||||
/**
|
||||
*
|
||||
* MinusExpression
|
||||
*
|
||||
* MinusExpression.
|
||||
*/
|
||||
public class MinusExpression extends Expression {
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.interpreter;
|
||||
|
||||
/**
|
||||
*
|
||||
* MultiplyExpression
|
||||
*
|
||||
* MultiplyExpression.
|
||||
*/
|
||||
public class MultiplyExpression extends Expression {
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.interpreter;
|
||||
|
||||
/**
|
||||
*
|
||||
* NumberExpression
|
||||
*
|
||||
* NumberExpression.
|
||||
*/
|
||||
public class NumberExpression extends Expression {
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.interpreter;
|
||||
|
||||
/**
|
||||
*
|
||||
* PlusExpression
|
||||
*
|
||||
* PlusExpression.
|
||||
*/
|
||||
public class PlusExpression extends Expression {
|
||||
|
||||
|
Reference in New Issue
Block a user