java的一些特殊标示符
兄弟看java jdk帮助和java源代码时发现里面有些从来没用过的特殊符号。不解,那位前辈指点一下。
下面是java TreeSet的源码
public class TreeSet <E>
extends AbstractSet <E>
implements SortedSet <E> , Cloneable, java.io.Serializable
{
private transient SortedMap <E,Object> m; // The backing Map
private transient Set <E> keySet; // The keySet view of the backing Map
// Dummy value to associate with an Object in the backing Map
private static final Object PRESENT = new Object();
private TreeSet(SortedMap <E,Object> m) {
this.m = m;
keySet = m.keySet();
}
public TreeSet() {
this(new TreeMap <E,Object> ());
}
public TreeSet(Comparator <? super E> c) {
this(new TreeMap <E,Object> (c));
}
public TreeSet(Collection <? extends E> c) {
this();
addAll(c);
}
public TreeSet(SortedSet <E> s) {
this(s.comparator());
addAll(s);
}
public Iterator <E> iterator() {
return keySet.iterator();
}
public int size() {
return m.size();
}
public boolean isEmpty() {
return m.isEmpty();
}
public boolean contains(Object o) {
return m.containsKey(o);
}
public boolean add(E o) {
return m.put(o, PRESENT)==null;
}
public boolean remove(Object o) {
return m.remove(o)==PRESENT;
}
public void clear() {
m.clear();
}
public boolean addAll(Collection <? extends E> c) {