📄 unorderedpair.java
字号:
package edu.stanford.nlp.util;import java.util.*;/** * Unordered Pair * * Class for holding an unordered pair of objects * * @author Dan Klein * @version 2/7/01 */public class UnorderedPair extends Pair { public String toString() { return "{"+first+","+second+"}"; } public boolean equals(Object o) { if (o instanceof UnorderedPair) { UnorderedPair p = (UnorderedPair)o; return (((first==null ? p.first==null : first.equals(p.first)) && (second==null ? p.second==null : second.equals(p.second))) || ((first==null ? p.second==null : first.equals(p.second)) && (second==null ? p.first==null : second.equals(p.first)))); } return false; } public int hashCode() { return first.hashCode() ^ second.hashCode(); } public UnorderedPair() {first = null; second = null;} public UnorderedPair(Object first, Object second) { this.first = first; this.second = second; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -