vendordescriptor.java
来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 66 行
JAVA
66 行
/*
* $Id: VendorDescriptor.java,v 1.1 2003/11/25 11:41:21 epr Exp $
*/
package org.jnode.driver.pci;
import java.util.HashMap;
/**
* @author epr
*/
public class VendorDescriptor {
private final int id;
private final String name;
private final HashMap devices = new HashMap();
public VendorDescriptor(int id, String name) {
this.id = id;
this.name = name;
}
/**
* Gets the ID of the vendor
*/
public int getId() {
return id;
}
/**
* Gets the Name of the vendor
*/
public String getName() {
return name;
}
/**
* Gets the descriptor of the device with the given id.
* @param deviceId
* @return Unknown device if not found, never null
*/
public DeviceDescriptor findDevice(int deviceId) {
DeviceDescriptor result;
result = (DeviceDescriptor)devices.get(new Integer(deviceId));
if (result == null) {
result = new DeviceDescriptor(deviceId, "? (" + deviceId + ")");
}
return result;
}
/**
* Add a device descriptor of a device of this vendor
* @param device
*/
protected void addDevice(DeviceDescriptor device) {
devices.put(new Integer(device.getId()), device);
}
/**
* @see java.lang.Object#toString()
*/
public String toString() {
return getName();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?