티스토리 뷰
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | package com.hanbit.oop.serviceImpl; import com.hanbit.oop.domain.MemberBean; import com.hanbit.oop.service.AdminService; public class AdminServiceImpl implements AdminService{ int count; MemberBean member; MemberBean[] list; public AdminServiceImpl(int limit){ count=0; member=new MemberBean(); list=new MemberBean[limit]; } @Override public void addMember(MemberBean member) { list[count]=member; for(int i=0;i<(count+1);i++){ System.out.println(list[i].toString()); } count++; } @Override public MemberBean[] getMembers() { return list; } @Override public int countMembers() { return count; } @Override public MemberBean findById(String id) { member=new MemberBean(); for(int i=0;i<list.length;i++){ if(id.equals(list[i].getId())){ member=list[i]; } } return member; } @Override public void updatePass(MemberBean member) { // TODO Auto-generated method stub } @Override public MemberBean[] findByName(String name) { int x=0; for(int i=0;i<list.length;i++){ if(name.equals(list[i].getName())){ x++; } } MemberBean[] members=new MemberBean[x]; int j=0; for(int i=0;i<list.length;i++){ if(name.equals(list[i].getName())){ members[j]=list[i]; j++; } if(x==j){ break; } } return members; } } | cs |
'1. 자바' 카테고리의 다른 글
(자바의정석) 자바> PersonService.java (0) | 2020.05.24 |
---|---|
Txt: Lambda 5 가지 종류 (0) | 2020.05.24 |
main-swing Calculator (0) | 2020.05.24 |
main-JoptionPane Admin (0) | 2020.05.24 |
main-swing Employee (0) | 2020.05.24 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Algorithm
- nodejs
- intellij
- terms
- JUnit
- Java
- jQuery
- Python
- FLASK
- database
- Eclipse
- SpringBoot
- AWS
- maven
- COLAB
- Git
- vscode
- mariadb
- Mongo
- Oracle
- KAFKA
- JPA
- Mlearn
- React
- springMVC
- SQLAlchemy
- Django
- tensorflow
- ERD
- docker
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
글 보관함