📄 unorderedpair.java
字号:
public class UnorderedPair<T> extends Pair<T>
{
public UnorderedPair()
{
setFirst(null);
setSecond(null);
}
public UnorderedPair(T firstItem, T secondItem)
{
setFirst(firstItem);
setSecond(secondItem);
}
public boolean equals(Object otherObject)
{
if (otherObject == null)
return false;
else if (getClass( ) != otherObject.getClass( ))
return false;
else
{
UnorderedPair<T> otherPair =
(UnorderedPair<T>)otherObject;
return (getFirst( ).equals(otherPair.getFirst( ))
&& getSecond( ).equals(otherPair.getSecond( )))
||
(getFirst( ).equals(otherPair.getSecond( ))
&& getSecond( ).equals(otherPair.getFirst( )));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -