[문자열 덧셈 계산기] 심규선 미션 제출합니다.#3
Open
gyuseon25 wants to merge 24 commits intoInQ-InQ-InQ-InQ-InQ:mainfrom
Open
Conversation
|
|
||
| import java.util.ArrayList; | ||
| import java.util.Arrays; | ||
| import java.util.List; |
커스텀 구분자에 숫자가 들어갔을 때 예외처리나 계산이 진행되도록 해야될 것 같아요 |
| private boolean isCustomDelimiter = false; | ||
|
|
||
| public void extractCustomDelimiter(String input) { | ||
| if(input.startsWith("//") && input.substring(3,5).equals("\\n")){ |
There was a problem hiding this comment.
서비스에서 지속적으로 사용되는 상수들을 final이나 enum으로 관리하는 것이 요구사항이 바뀌더라도 쉽게 변경할 수 있어 좋을 것 같아요
Member
Author
There was a problem hiding this comment.
enum을 적용하면 나중에 유지보수하기 편할거 같네요 !!
|
|
||
| public class Extractor { | ||
|
|
||
| private List<Character> delimiters = new ArrayList<>(Arrays.asList(',', ':')); |
There was a problem hiding this comment.
delimiters 객체가 외부의 개입으로 변경될 가능성이 있을 것 같아요.
final로 변경하거나 다른 방식으로 처리하는 것이 좋아보입니다!
| } | ||
| } | ||
|
|
||
| public void extractNumbers(String input, List<Long> numbers) { |
There was a problem hiding this comment.
input과 numbers를 외부에서 받아 해당 객체에 값을 추가하는 것 같은데,
현재 방식은 데이터 무결성 및 일관성을 저해하고 있는 방법인 것 같아요.
외부에서 값을 받아 이 메서드 내부에서 리스트를 직접 생성해 반환하는 로직이 더 안전한 방법일 것 같습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📁 디렉토리 구조
🛠️ 구현한 기능