⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 membershipuos.java

📁 国外的数据结构与算法分析用书
💻 JAVA
字号:
/* MembershipUos.java
 * ---------------------------------------------
 * Copyright (c) 2001 University of Saskatchewan
 * All Rights Reserved
 * --------------------------------------------- */
 
package dslib.base;

/**	A ContainerUos class which includes a membership test has and 
	equality test membershipEqual */
public interface MembershipUos extends ContainerUos
{
	/**	Does the structure contain 'y'?. 
		@param y item whose presence is to be determined */
	public boolean has(Object y);
 
// 		Suggested implementation
//	/**	Defines the type of comparison to use
//		Initialize objectReferenceComparison to false, 
//		so the default is compare contents */
//	protected boolean objectReferenceComparison = false;
  
//		Suggested implementation
	/**	Test whether x equals y using the current comparison mode 
		@param x item to be compared to y
		@param y item to be compared to x */
	public boolean membershipEquals(Object x, Object y);
//  	{
//  		if (objectReferenceComparison)
//  			return  (x==y);
//  		else if ((x instanceof Comparable) && (y instanceof Comparable))
//  			return  0==((Comparable)x).compareTo((Comparable)y);
//  		else if (x.equals(y))
//  			return true;
//  		else 
//  			return false;
//  	} 

	/**	Set comparison operations to use '=='or equals */
	public void compareObjectReferences();
//		suggested implementation
//		{
//			objectReferenceComparison = true;
//		}
 
	/**	Set comparison operations to use equal() or compareTo() */
	public void compareContents();
//		suggested implementation
// 		{
//			objectReferenceComparison =false;
//		} 

} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -