-
Notifications
You must be signed in to change notification settings - Fork 1
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
[1차 VER1.0] Java ToyProject upload by JuheeKang #12
base: main
Are you sure you want to change the base?
Conversation
// refresh 함수가 호출되는 경우 | ||
// 1. 분류기준 바뀔 때 | ||
// 2. 새로운 고객이 들어올 때 | ||
public void refresh() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refresh 메서드를 오버로딩해서 한 고객에 대해서만 업데이트하는 메서드가 있으면 좋을 것 같습니다!
고객 한 명을 추가했는데 모든 고객을 refresh한다면 비효율적이니까요 😀
this.totalTime = totalTime; | ||
this.totalPay = totalPay; | ||
} | ||
public Customer(String cName, String cId, Integer totalTime, Integer totalPay, Group group) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 생성자를 통해 기준에 맞지 않는 그룹을 넣을 수 있지 않을까라는 생각이 듭니다!
public static Groups getInstance(){ | ||
if(allGroups == null){ | ||
allGroups = new Groups(); | ||
allGroups.add(new Group(new Parameter(), GroupType.NONE)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 run할때 추가해줬었는데 getInstance에 넣을 생각을 못했네요..
덕분에 배워갑니다!👍
System.out.println("Input Customer's Spent Time:"); | ||
try{ | ||
String time = nextLine(Message.END_MSG); | ||
customer.setTotalTime(Integer.parseInt(time)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사용자가 문자를 입력했을때 예외가 발생하지 않을까요?!
System.out.printf("Input Minimum Spent Time:"); | ||
String spentTime = nextLine(Message.END_MSG); | ||
Parameter parameter = group.getParameter(); | ||
parameter.setMinTime(Integer.parseInt(spentTime)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Customer, Parameter의 시간, 금액 입력에 대해서 -값은 입력이 안되게 막으면 더 좋을 것 같습니다!
아직 예외처리하는 부분이 어려운것같습니다ㅠ
확인해주셔서 감사합니다 !