Skip to content

Instantly share code, notes, and snippets.

View libliboom's full-sized avatar
🎯
Focusing

Eric Lee libliboom

🎯
Focusing
View GitHub Profile
public abstract interface IFile {
public abstract void close();
}
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 {
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() {
bounds.translateBy(10, 20) // 변경 가능한 Rectangle 객체
bounds = bounds.translateBy(10, 20) // 값 스타일 Rectangle 객체
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);
}
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]);
}
class ExchangeRate {
private int CountryCode;
public void b() {
Info info = new Info();
int d = info.day;
int m = info.month;
int y = info.year;
}
class GraphicEditor {
...
public void mouseDown() {
tool.mouseDown();
}
...
}
class RectangleTool {
private GraphicEditor editor;
class GraphicEditor {
...
public void mouseDown() {
tool.mouseDown(this);
}
...
}
class RectangleTool {
...
// 의존관계가 있는 경우
Rectangle void setWidth(int width) {
this.width = width;
area = width * height;
}
// 의존관계가 있으나 명확하지 않은 경우
Widget void setBorder(int width) {
this.width = width;
notifyListener