Last active
August 29, 2015 14:01
-
-
Save dha-lo-jd/3b2a62676a033ae0adb9 to your computer and use it in GitHub Desktop.
オープンソース友達
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 class なんこつちゃんの友達 { | |
public static void main(String[] args) { | |
Object 友達 = null; | |
System.out.println("なんこつちゃん 仲良く、仲良"); | |
友達.toString(); | |
} | |
} |
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
import java.util.Iterator; | |
import com.google.common.collect.Lists; | |
public class なんこつちゃん implements Friendable { | |
private static final class EmptyFriends implements Frineds { | |
private static final Iterable<Frined> noFriends = Lists.newArrayList(); | |
public void add(Frined friend) { | |
return; | |
} | |
@Override | |
public Iterator<Frined> iterator() { | |
return noFriends.iterator(); | |
} | |
} | |
private static final Friends friends = new EmptyFriends(); | |
public Frineds getFriends() { | |
return friends; | |
} | |
public void addFriend(Frined friend) { | |
return friends.add(friend); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment