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

📄 freespace.java

📁 Java的面向对象数据库系统的源代码
💻 JAVA
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Core License version 1 published by ozone-db.org.//// Copyright (C) 2003-@year@, Leo Mekenkamp. All rights reserved.//// $Id: FreeSpace.java,v 1.1.2.1 2004/04/10 10:06:51 per_nyfelt Exp $package org.ozoneDB.core.storage.gammaStore;import java.util.Comparator;public final class FreeSpace {    private static Comparator sizeComparator = new Comparator() {                public int compare(Object o1, Object o2) {            return compare((FreeSpace) o1, (FreeSpace) o2);        }                private int compare(FreeSpace o1, FreeSpace o2) {            if (o1 == o2) {                return 0;            }            if (o1 == null) {                return -1;            }            if (o2 == null) {                return 1;            }            int result = o1.getSize() - o2.getSize();            if (result == 0) {                result = o1.getClusterId() - o2.getClusterId();                if (result == 0) {                    result = o1.getLocation() - o2.getLocation();                }            }            return result;        }    };        public static Comparator getSizeComparator() {        return sizeComparator;    }        private int clusterId;    private int location;    private int size;        public FreeSpace(int clusterId, int location, int size) {        this.clusterId = clusterId;        this.location = location;        this.size = size;    }        public int getClusterId() {        return clusterId;    }    public int getLocation() {        return location;    }        public int getSize() {        return size;    }        public int hashCode() {        return (clusterId + 1) * location;    }        }

⌨️ 快捷键说明

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