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

📄 holdset.java

📁 一个关于图书馆的服务器的管理程序
💻 JAVA
字号:
package library;
import java.util.*;

/**
* A class representing a set of holds
*
* @author CTE
* @version 1.0
*/
public class HoldSet{
   
    // set is stored as a vector.
    private Vector set = null;
    
    /**
     * class HoldSet constructor.
     *
     */
    public HoldSet() {
	set = new Vector();
    } 
    
    /**
     * class HoldSet constructor
     * @param inSet Vector of holds to initialize this set
     */
    public HoldSet( Vector inSet ) {
	set = new Vector( inSet );
    }
    
    /**
     * getHoldAt returns the Hold at the specified index
     * @param index int index of hold to return
     * @return Hold 
     */
    public Hold getHoldAt( int index ) {
	return (Hold)set.get(index);
    }

    /**
     * getHoldCount returns the number of holds in this set
     * @return int
     */
    public int getHoldCount() {
	return set.size();
    }
    
    /**
     * addHold adds a hold to this set
     * @param hold Hold hold to add to the set
     * @return void
     */
    public void addHold( Hold hold ) {
	set.add( hold );
    }

    /**
     * removeHoldAt removes and returns the hold at the specified index
     * @param index int index of hold to remove
     * @return Hold
     */
    public Hold removeHoldAt( int index ) {
	return (Hold)set.remove( index );
    }
    
    /**
     * removeHold removes the specified hold from the set
     * @param hold Hold hold to remove
     * @return boolean
     */
    public boolean removeHold( Hold hold ) {
	return set.remove( hold );
    }
}









⌨️ 快捷键说明

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