Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kth/계산기 1차 코드 리뷰 #2

Open
wants to merge 98 commits into
base: kth/main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 80 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
3ff5220
Feat : Input클레스 추가 및 선택 입력 메소득 추가
xogns4909 Aug 23, 2023
3d40f99
Feat : Options Enum 추가
xogns4909 Aug 23, 2023
a2d84a9
Feat : 입력에 대한 예외처리 클래스 추가
xogns4909 Aug 23, 2023
adee2c4
Feat : 식 입력 메소드 추가
xogns4909 Aug 23, 2023
3dace13
Feat : 저장 클래스 추가 및 저장 메소드 추가
xogns4909 Aug 23, 2023
0d743bd
Feat : 결과 호출 메서드 추가
xogns4909 Aug 23, 2023
f1db66f
Feat : 결과 출력 메소드 추가
xogns4909 Aug 23, 2023
d6b26c0
Feat : 연산자 우선순위 정의 메소드 추가
xogns4909 Aug 23, 2023
250674d
Feat : 중위 표현식 후위표현식으로 변경 로직 추가
xogns4909 Aug 23, 2023
4dfb3b9
Feat : 중위 표기식 변경 테스트 로직 추가
xogns4909 Aug 23, 2023
7ab770b
Fix : 중위 연산식 변환 로직 수정
xogns4909 Aug 25, 2023
fd48306
Feat : 후위 연산식 계산 로직 추가
xogns4909 Aug 25, 2023
a79039f
Feat : 후위연산식 계산 테스트 코드
xogns4909 Aug 25, 2023
164cf9a
Feat : 게산기 실행 로직 추가
xogns4909 Aug 25, 2023
b528194
test : 중위 표기식 -> 후위표기식 변환 테스트
xogns4909 Aug 25, 2023
5d05bb9
chore : 출력 형식 변환
xogns4909 Aug 25, 2023
ad1ca5d
Refactor : 메인 메소드 선택값 예외처리
xogns4909 Aug 25, 2023
5b6986c
Fix : 입력값 예외처리 버그 수정
xogns4909 Aug 25, 2023
00a52a0
Feat : 식 입력 검증 클래스 추가
xogns4909 Aug 25, 2023
ecd0d2d
chore : 지역 변수 class 변수 변환
xogns4909 Aug 25, 2023
7beba5c
chore : 사용하지 않는 변수 삭제
xogns4909 Aug 25, 2023
7551509
Feat : input 인터페이스 추가
xogns4909 Aug 25, 2023
3557acc
Fix : 멀티 스레드 경우 데이터 공유방지 static 삭제
xogns4909 Aug 25, 2023
f0b3c9f
Feat : SelectInput class 추가
xogns4909 Aug 25, 2023
527efac
Feat : 식 입력 클레스 추가
xogns4909 Aug 25, 2023
06ab0ee
Feat : Calculator 인터페이스 추가
xogns4909 Aug 25, 2023
d14b8bd
Refactor : 후위 표기식 계산 클래스 분리
xogns4909 Aug 25, 2023
8066eb2
Feat : 중위표기식 계산 클래스 추가
xogns4909 Aug 25, 2023
1ea1141
Test : 중위 표현식 계산 테스트
xogns4909 Aug 25, 2023
90746b5
Fix : 피연산자 순서 버그 수정
xogns4909 Aug 25, 2023
01f2074
Refactor : 변수 이름 수정 및 식 입력값 예외 처리
xogns4909 Aug 25, 2023
28c4398
Chore : 입력 형식 수정
xogns4909 Aug 25, 2023
da609f1
Fix : 식 예외처리 버그 수정
xogns4909 Aug 25, 2023
93f245e
Style : 코드 빈칸 삭제
xogns4909 Aug 25, 2023
2905ce4
Refactor : Main class -> Excution 클래스 이동
xogns4909 Aug 25, 2023
c9bcc79
Chore : gitignore,gradle 추가
xogns4909 Aug 25, 2023
f755333
Refactor : 예외처리 방식 수정
xogns4909 Aug 25, 2023
4e2831c
Fix : 문자 입력시 버그 수정
xogns4909 Aug 25, 2023
eedc44c
Refactor : 리턴 타입 변경
xogns4909 Aug 25, 2023
57f95cf
Create README.md
xogns4909 Aug 25, 2023
476aed8
Merge branch 'main' of https://github.com/xogns4909/code-review
xogns4909 Aug 25, 2023
8048649
refactor : 필요없는 조건문 삭제
xogns4909 Aug 28, 2023
bddb95f
Refactor : SeletValidtation 정규식 Pattern 이용
xogns4909 Aug 28, 2023
fb2677d
Chore : postFix 정적 변수 인스턴스변수로 수정
xogns4909 Aug 28, 2023
cf0898b
Style : 변수명 소문자로 변경
xogns4909 Aug 28, 2023
e3049bb
Refactor: 기존 Input Interface class 로수정
xogns4909 Aug 30, 2023
7cc00b6
Refactor : main에 throws IOException을 삭제하기 위한 예외처리 추가
xogns4909 Aug 30, 2023
0b70d47
Feat : Input Interface 생성
xogns4909 Aug 31, 2023
f7565d3
Refactor : Pattern 클래스를 이용한 정규식 검증으로 변경
xogns4909 Aug 31, 2023
a26b217
Refactor : 상수를 사용한 매직넘버 삭제
xogns4909 Aug 31, 2023
58a2f06
Refactor : 접근 제어자 변경
xogns4909 Sep 1, 2023
0e4b06c
Style : 클래스명 변경
xogns4909 Sep 1, 2023
71928f3
Feat : OutPut Interface 추가
xogns4909 Sep 1, 2023
0b728d3
Feat : print 메소드 추가
xogns4909 Sep 1, 2023
2410415
Refactor : Output 을 이용한 출력로직으로 변경
xogns4909 Sep 1, 2023
2256b3e
Refactor : Repositorty 컬렉션 LinkedHashMap 변경
xogns4909 Sep 1, 2023
a157b8b
Fix : 조회로직 수정
xogns4909 Sep 1, 2023
74c7172
Fix : 접근지정자 추가 및 static 지정
xogns4909 Sep 1, 2023
53e1a08
Chore : if 문 swtich 로 변경
xogns4909 Sep 1, 2023
b7cb3ab
Chore : 메소드명 수정
xogns4909 Sep 1, 2023
5dc13a4
Refactor : 모듈화를 통한 depth 2 문제 해결
xogns4909 Sep 1, 2023
503e594
Chore : 클래스명 Calculator -> Accmulator 로 변경
xogns4909 Sep 1, 2023
1c27980
Chore : Excution 클래스명 변경
xogns4909 Sep 1, 2023
05b3b99
Chore : 삭제하지 않는 클레스 삭제
xogns4909 Sep 1, 2023
35c6e77
Feat : Calculator 클래스 추가
xogns4909 Sep 1, 2023
5d9a319
Feat : 후위표기식으로 변환 클래스 추가
xogns4909 Sep 1, 2023
5f2e78e
Chore : 사용하지 않는 import 삭제
xogns4909 Sep 1, 2023
a1fa676
Chore : googleStyle 컨벤션 적용
xogns4909 Sep 1, 2023
87dcb6b
Test : 사칙연산 테스트
xogns4909 Sep 1, 2023
7107d5c
Test : 사칙연산 별 테스트 케이스 추가
xogns4909 Sep 1, 2023
123488d
Test : 중위표기식 후위표기식 변환 테스트 케이스 추가
xogns4909 Sep 1, 2023
2c23bcb
Test : 옵션선택 검증테스트 추가
xogns4909 Sep 1, 2023
5ae1ab2
Test : 옵션 입력 검증 테스트
xogns4909 Sep 1, 2023
5dd678d
Test : 식 입력 테스트 추가
xogns4909 Sep 1, 2023
308f1c7
Test : 식 입력 검증 테스트 추가
xogns4909 Sep 1, 2023
cfddb59
Test : 테스트 데이터 변경
xogns4909 Sep 1, 2023
a5bfd08
Test : @CsvSource를 이용한 테스트로 수정
xogns4909 Sep 1, 2023
8152b7f
Test : 인메모리 저장 테스트 추가
xogns4909 Sep 1, 2023
f399249
Test : Repository 테스트 시 생성
xogns4909 Sep 1, 2023
79a839f
Refactor : run 메소드 static 삭제
xogns4909 Sep 7, 2023
1cc812a
Refactor : testCase delimiter 추가
xogns4909 Sep 11, 2023
7d1273a
Refactor :enum을 이용한 연산자 비교로 변경
xogns4909 Sep 11, 2023
18d1e37
Refactor: PatternValidator Util 클래스를 이용한 정규식 로직으로 수정
xogns4909 Sep 11, 2023
0d0ade7
Refactor : Pattern.checkOperatorValue 메소드 적용 및 모듈화
xogns4909 Sep 11, 2023
dc51378
Refactor : InputView OutputView 통합
xogns4909 Sep 11, 2023
8eadf1b
feat : inputInterface 추가
xogns4909 Sep 11, 2023
6a09420
Refactor : try catch 문을 이용한 throw Exception 처리
xogns4909 Sep 11, 2023
d06b78e
Fix : 계산할때 마다 저장소 생성 문제 해결
xogns4909 Sep 11, 2023
0a02174
Refactor : 저장소 컬렉션 변경 및 Ouput Interface Repository 의존성 삭제
xogns4909 Sep 11, 2023
6ce8564
Fix : stackNullPoint 문제 해결
xogns4909 Sep 11, 2023
e8baa79
Refacor : 상수명 수정
xogns4909 Sep 11, 2023
d2292a4
Test : 입력값 예외처리 테스트 수정
xogns4909 Sep 11, 2023
f0e3eda
Fix : 함수명 수정 및 implements 추가
xogns4909 Sep 11, 2023
fd87dbc
Chore : 사용하지 않는 import 삭제 및 컨벤션에 맞게 수정
xogns4909 Sep 11, 2023
48b595b
Refactor : coumpute메소드 모듈화
xogns4909 Sep 12, 2023
c106797
Fix : 조회시 출력 결과 버그 수정
xogns4909 Sep 12, 2023
6be3443
refactor : 접근지정자 추가
xogns4909 Sep 12, 2023
b2d4465
Refactor : 컬렉션 리턴시 새 리스트 생성후 리턴
xogns4909 Sep 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Created by https://www.toptal.com/developers/gitignore/api/intellij
xogns4909 marked this conversation as resolved.
Show resolved Hide resolved
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml

# Azure Toolkit for IntelliJ plugin
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
.idea/**/azureSettings.xml

# End of https://www.toptal.com/developers/gitignore/api/intellij
20 changes: 20 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plugins {
id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.1'
}

test {
useJUnitPlatform()
}
234 changes: 234 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################

# Attempt to set APP_HOME

# Resolve links: $0 may be a link
app_path=$0

# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

warn () {
echo "$*"
} >&2

die () {
echo
echo "$*"
echo
exit 1
} >&2

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi

# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.

# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )

JAVACMD=$( cygpath --unix "$JAVACMD" )

# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#

eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'

exec "$JAVACMD" "$@"
Loading