idediskpartitiondevice.java

来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 64 行

JAVA
64
字号
/*
 * $Id: IDEDiskPartitionDevice.java,v 1.1 2003/11/25 11:50:41 epr Exp $
 */
package org.jnode.driver.ide;

import org.jnode.driver.Bus;
import org.jnode.driver.Device;
import org.jnode.fs.partitions.PartitionTableEntry;

/**
 * @author epr
 */
public class IDEDiskPartitionDevice extends Device {

	/** The device i'm a partition on */
	private final IDEDevice parent;
	/** The first sector of this partition */
	private final long startSector;
	/** The number of sectors of this partition */
	private final long sectors;
	private final PartitionTableEntry pte;

	/**
	 * Create a new instance
	 * @param id
	 */
	public IDEDiskPartitionDevice(Bus bus, String id, IDEDevice parent, PartitionTableEntry pte, long startSector, long sectors) {
		super(bus, id);
		this.parent = parent;
		this.pte = pte;
		this.startSector = startSector;
		this.sectors = sectors;
	}

	/**
	 * Gets the device this partition is on.
	 */
	public IDEDevice getParent() {
		return parent;
	}

	/**
	 * Gets the number of sectors of this partition
	 */
	public long getSectors() {
		return sectors;
	}

	/**
	 * Gets the first sector of this partition
	 */
	public long getStartSector() {
		return startSector;
	}

	/**
	 * Gets the partition table entry specifying this device.
	 * @return A PartitionTableEntry or null if no partition table entry exists.
	 */
	public PartitionTableEntry getPartitionTableEntry() {
		return pte;
	}
}

⌨️ 快捷键说明

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