This file contains 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
public abstract interface IFile { | |
public abstract void close(); | |
} |
This file contains 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
public MapRecipe(Map<?, ?> map) { | |
if (map == null) throw new NullPointerException("map is null"); | |
entries = new ArrayList<Object[]>(map.size()); | |
if (RecipeHelper.hasDefaultConstructor(map.getClass())) { | |
this.typeClass = map.getClass(); | |
} else if (map instanceof SortedMap) { | |
this.typeClass = TreeMap.class; | |
} else if (map instanceof ConcurrentMap) { | |
this.typeClass = ConcurrentHashMap.class; | |
} else { |
This file contains 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
class Transaction { | |
private int value; | |
/*package*/ Transaction(int value, Account credit, Account debit) { | |
this.value = value; | |
credit.addCredit(this); | |
debit.addDebit(this); | |
} | |
/*package*/ int getValue() { |
This file contains 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
bounds.translateBy(10, 20) // 변경 가능한 Rectangle 객체 | |
bounds = bounds.translateBy(10, 20) // 값 스타일 Rectangle 객체 |
This file contains 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
public String substring(int beginIndex) { | |
if (beginIndex < 0) { | |
throw new StringIndexOutOfBoundsException(beginIndex); | |
} | |
int subLen = value.length - beginIndex; | |
if (subLen < 0) { | |
throw new StringIndexOutOfBoundsException(subLen); | |
} | |
return (beginIndex == 0) ? this : new String(value, beginIndex, subLen); | |
} |
This file contains 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
private String name; | |
public void runTest() throws Exception { | |
Class[] noArguments = new Class[0]; | |
Method method = getClass().getMethod(name, noArguments); | |
method.invoke(this, new Object[0]); | |
} |
This file contains 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
class ExchangeRate { | |
private int CountryCode; | |
public void b() { | |
Info info = new Info(); | |
int d = info.day; | |
int m = info.month; | |
int y = info.year; | |
} |
This file contains 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
class GraphicEditor { | |
... | |
public void mouseDown() { | |
tool.mouseDown(); | |
} | |
... | |
} | |
class RectangleTool { | |
private GraphicEditor editor; |
This file contains 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
class GraphicEditor { | |
... | |
public void mouseDown() { | |
tool.mouseDown(this); | |
} | |
... | |
} | |
class RectangleTool { | |
... |
This file contains 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
// 의존관계가 있는 경우 | |
Rectangle void setWidth(int width) { | |
this.width = width; | |
area = width * height; | |
} | |
// 의존관계가 있으나 명확하지 않은 경우 | |
Widget void setBorder(int width) { | |
this.width = width; | |
notifyListener |
OlderNewer