btreerecorduos.java

来自「国外的数据结构与算法分析用书」· Java 代码 · 共 42 行

JAVA
42
字号
/* BtreeRecordUos.java
 * ---------------------------------------------
 * Copyright (c) 2001 University of Saskatchewan
 * All Rights Reserved
 * --------------------------------------------- */

package dslib.file;

import java.io.Serializable;

/**	A record containing a key and an item. */
public class BtreeRecordUos implements Serializable
{
	/**	The key associated with this record */
	public Comparable key;

	/**	The item associated with this record */
	public Object item;

	/**	Put the key and item into the record. <br>
		Analysis: Time = O(1) 
		@param newKey The key associated with this record
		@param newItem The item associated with this record */
	public BtreeRecordUos (Comparable newKey, Object newItem) 
	{
		key = newKey;
		item = newItem;
	}   
     
	/**	String representation of the record for printing. <br>
		Analysis: Time = O(1) */
	public String toString()
	{
		return (key.toString() + " " + item.toString());
	}
	
	public String keyToString()
	{
		return key.toString();
	}
} 

⌨️ 快捷键说明

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