본문 바로가기

Java/Method

AWT Method II Font Method Explain Font(String name, int style, int size) name : 사용할 Font의 이름 style : Font의 Style 지정 size : Font의 크기 Color Method Explain Color(int r, int g, int b) 0~255의 정수 값을 이용해 색 조절(r : red / g : green / b : blue) Color(float r, float g, float b) 0.0~1.0의 정수 값을 이용해 색 조절(r : red / g : green / b : blue) Color(int r, int g, int b, int a) a : Alpha 값이 추가되어 있으며 0~255사이의 정수 값을 갖음 Color(float r, .. 더보기
AWT Method I Container Method Explain Color getBackground() Component의 배경색을 얻음 void setBackground(Color c) Component의 배경색을 지정된 색으로 변경 Cursor getCursor() Component에 지정된 Cursor를 얻음 void setCursor(Cursor c) Component의 Cursor를 지정 Font getFont() Component에 지정되어 있는 Font를 얻음 void setFont(Font f) Component의 Font를 지정 Color getForeground() Component의 전경색을 얻음 void setForeground(Color c) Component의 전경색을 지정 int getHeigth.. 더보기
Thread Method Explain Thread() Thread의 생성자 Thread(ThreadGroup group, String name) ThreadGroup을 지정하는 Thread 생성자 Thread(ThreadGroup group, Runnable target) Thread(ThreadGroup group, Runnable target, String name) Thread(ThreadGroup group, Runnable target, String name, long stackSize) Thread currentThread() 현재 실행중인 Thread의 참조를 반환 String getName() Thread의 이름을 반환 run() 호출한 Method 내에서 Thread로 작업 진행 start() 호출.. 더보기
Random Method Explain Random() System.현재시간을 Seed 값으로 사용하는 Random Instance를 생성 Random(long seed) 매개변수 Seed를 Seed 값으로 사용하는 Random Instance를 생성 Boolean nextBoolean() boolean Type의 난수를 반환 void nextBytes(byte[] bytes) Byte 배열에 Byte Type의 난수를 채워 반환 double nextDouble() Double Type의 난수를 반환 float nextGaussian() float Type의 난수를 반환 double nextGaussian() 평균은 0.0이고 표준편차는 1.0인 Gaussian 분포에 따른 double 형 난수를 반환 int nex.. 더보기
Properties MethodExplain Properties() Properties 객체 생성 Properties(Properties defaults) 지정된 Properties에 저장된 목록을 가진 Properties() 객체 생성 String getProperty(String key) 지정된 Key의 Value를 반환 String getProperty(String key, String defaultValue) 지정된 Key의 Value를 반환(Key를 못 찾을 시 defaultValue 반환) void list(PrintStream out) 지정된 PrintStream에 저장된 목록 출력 void list(PrintWriter out) 지정된 PrintWriter에 저장된 목록 출력 void load(InputStr.. 더보기
TreeMap Method Explain TreeMap() TreeMap 객체 생성 TreeMap(Comparator c) 지정한 Comparator를 기준으로 정렬하는 TreeMap 객체를 생성 TreeMap(Map m) 주어진 Map에 저장된 모든 요소를 포함하는 TreeMap을 생성 TreeMap(SortedMap m) 주어진 SortedMap에 저장된 모든 요소를 포함하는 TreeMap을 생성 void clear() TreeMap에 저장된 모든 객체를 제거 Object clone() 현재 TreeMap을 복제해서 반환 Comparator comparator() TreeMap의 정렬기준이 되는 Comparator를 반환(지정되지 않으면 null 반환) boolean containsKey(Object key) Tr.. 더보기
HashMap MethodExplain HashMap() HashMap 객체 생성 HashMap(int initialCapacity) 지정된 값을 초기용량으로 하는 HashMap 객체를 생성 HashMap(int initialCapacity, float loadFactor) 지정된 초기용량과 load factor의 HashMap 객체를 생성 HashMap(Map m) 주어진 Map에 저장된 모든 요소를 포함하는 HashMap을 생성 void clear() HashMap에 저장된 모든 객체를 제거 Object clone() 현재 HashMap을 복제해서 반환 boolean containsKey(Object key) HashMap에 지정된 Key가 포함되어있는지 확인 boolean containsValue(Object v.. 더보기
TreeSet Method Explain TreeSet() 기본 생성자 TreeSet(Collection c) 주어진 Collection을 저장하는 TreeSet을 생성 TreeSet(Comparator c) 주어진 정렬조건 정렬하는 TreeSet을 생성 TreeSet(SortedSet s) 주어진 SortedSet을 구현한 Collection을 저장하는 TreeSet을 생성 boolean add(Object o) boolean addAll(Collection c) 지정된 객체 또는 Collection의 객체들을 Collection에 추가 void clear() 저장된 모든 객체를 삭제 Object clone() TreeSet을 복제하여 반환 Comparator comparator() TreeSet의 정렬기준(Comp.. 더보기
Queue MethodExplain Object element() 삭제없이 저장된 요소를 읽어온다. queue가 비어있을 시 Exception을 발생시킴 boolean offer(Object o) Queue에 객체 저장 후 성공 여부를 반환 Object peek() 삭제 없이 읽어 오며 Queue가 비었을 시 null을 반환 Object poll() Queue에서 꺼내오며 비어있을 시 null을 반환 Object remove() Queue에서 꺼내오며 비어있을 시 Exception을 발생 시킴 더보기
Stack MethodExplain boolean empty() Stack이 비어있는지 확인 Object peek() Stack의 맨 위에 저장된 객체를 반환. 꺼내지는 않으며 비어있을 시 null 반환 Object pop() Stack의 맨 위에 저장된 객체를 꺼냄 Object push(Object Item) Stack에 객체를 저장 int search(Object o) Stack에서 주어진 객체를 찾아 그위치를 반환 더보기