pair.java
来自「ZK 基础介绍 功能操作 模块 结合数据库操作」· Java 代码 · 共 67 行
JAVA
67 行
/* Pair.java{{IS_NOTE Purpose: Description: History: 2001/8/8, Tom M. Yeh: Created.}}IS_NOTECopyright (C) 2001 Potix Corporation. All Rights Reserved.{{IS_RIGHT This program is distributed under GPL Version 2.0 in the hope that it will be useful, but WITHOUT ANY WARRANTY.}}IS_RIGHT*/package org.zkoss.util;import org.zkoss.lang.Objects;/** * A pair of keys. It is used with DualHashSet and DualHashMap to * represent a pair of keys as an object. * * @author tomyeh */public class Pair { /** The first key. */ public final Object x; /** The second key. */ public final Object y; public Pair(Object x, Object y) { this.x = x; this.y = y; } /** Returns the first value of the pair. */ public Object getX() { return this.x; } /** Returns the second value of the pair. */ public Object getY() { return this.y; } //-- Object --// public final boolean equals(Object o) { if (!(o instanceof Pair)) return false; final Pair pair = (Pair)o; return Objects.equals(x, pair.x) && Objects.equals(y, pair.y); } public final int hashCode() { return Objects.hashCode(x) ^ Objects.hashCode(y); } public String toString() { return '(' + Objects.toString(x) + ", " + Objects.toString(y) + ')'; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?