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

📄 sortedcell.java

📁 生物物种进化历程的演示
💻 JAVA
字号:
package AccordionDrawer;/** * SortedCell is a helper class for AccordionDrawer. It's used in a * sortedSet in conjunction with the splitCells data structure, to * which it contains indices. The difference is that this one is * sorted (separately in X and Y), so that it can be used for binary * search. *  * We use the values of the cell positions at initialization time for * the sorting. Although we can never use these again as actual * positions, because those change with user interaction, the * *relative* placement can never change. *  * @author Tamara Munzner * @see AccordionDrawer.AccordionDrawer */class SortedCell { // implements Comparable {//    /**//    * Value of cell position at initialization time. Only used for//    * sorting. Should never be accessed externally. //    *///    private double value;//    /** //     * Index of cell in original splitCells array//     *///    int origindex;//////    SortedCell(int oindex, double val) {//	value = val;//	origindex = oindex;//    }////    void print() {//	System.out.println("sc value: " + value);//    }////    // implement Comparable interface - sort on value field//    public int compareTo(Object o) { //	if (value == ((SortedCell)o).value) return 0;//	else if (value < ((SortedCell)o).value) return -1;//	else return 1;//    };//    public boolean equals(Object o) {//	if (((SortedCell)o).value == value) {//	    return true;//	} else {//	    return false;//	}//    }}

⌨️ 快捷键说明

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