本文整理了Java中org.fourthline.cling.model.meta.Device.isRoot()
方法的一些代码示例,展示了Device.isRoot()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.isRoot()
方法的具体详情如下:
包路径:org.fourthline.cling.model.meta.Device
类名称:Device
方法名:isRoot
暂无
代码示例来源:origin: 4thline/cling
@Override
public String toString() {
return "(" + getClass().getSimpleName() + ") Identity: " + getIdentity().toString() + ", Root: " + isRoot();
}
}
代码示例来源:origin: 4thline/cling
public Resource[] getResources(Device device) throws ValidationException {
if (!device.isRoot()) return null;
Set<Resource> resources = new HashSet<>();
List<ValidationError> errors = new ArrayList<>();
log.fine("Discovering local resources of device graph");
Resource[] discoveredResources = device.discoverResources(this);
for (Resource resource : discoveredResources) {
log.finer("Discovered: " + resource);
if (!resources.add(resource)) {
log.finer("Local resource already exists, queueing validation error");
errors.add(new ValidationError(
getClass(),
"resources",
"Local URI namespace conflict between resources of device: " + resource
));
}
}
if (errors.size() > 0) {
throw new ValidationException("Validation of device graph failed, call getErrors() on exception", errors);
}
return resources.toArray(new Resource[resources.size()]);
}
代码示例来源:origin: 4thline/cling
protected Collection<D> findEmbeddedDevices(D current) {
Collection<D> devices = new HashSet<>();
if (!current.isRoot() && current.getIdentity().getUdn() != null)
devices.add(current);
if (current.hasEmbeddedDevices()) {
for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
devices.addAll(findEmbeddedDevices(embeddedDevice));
}
}
return devices;
}
代码示例来源:origin: 4thline/cling
Device nodeDevice = (Device) node.getUserObject();
if (nodeDevice.isRoot()) {
if (rootDeviceIcon != null) {
setIcon(new ImageIcon(rootDeviceIcon.getImage().getScaledInstance(24, 24, java.awt.Image.SCALE_SMOOTH)));
代码示例来源:origin: kingthy/TVRemoteIME
@Override
public String toString() {
return "(" + getClass().getSimpleName() + ") Identity: " + getIdentity().toString() + ", Root: " + isRoot();
}
}
代码示例来源:origin: kingthy/TVRemoteIME
protected Collection<D> findEmbeddedDevices(D current) {
Collection<D> devices = new HashSet();
if (!current.isRoot()) {
devices.add(current);
}
if (current.hasEmbeddedDevices()) {
for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
devices.addAll(findEmbeddedDevices(embeddedDevice));
}
}
return devices;
}
代码示例来源:origin: kingthy/TVRemoteIME
public Resource[] getResources(Device device) throws ValidationException {
if (!device.isRoot()) return null;
Set<Resource> resources = new HashSet<Resource>();
List<ValidationError> errors = new ArrayList<ValidationError>();
log.fine("Discovering local resources of device graph");
Resource[] discoveredResources = device.discoverResources(this);
for (Resource resource : discoveredResources) {
log.finer("Discovered: " + resource);
if (!resources.add(resource)) {
log.finer("Local resource already exists, queueing validation error");
errors.add(new ValidationError(
getClass(),
"resources",
"Local URI namespace conflict between resources of device: " + resource
));
}
}
if (errors.size() > 0) {
throw new ValidationException("Validation of device graph failed, call getErrors() on exception", errors);
}
return resources.toArray(new Resource[resources.size()]);
}
代码示例来源:origin: org.fourthline.cling/cling-core
@Override
public String toString() {
return "(" + getClass().getSimpleName() + ") Identity: " + getIdentity().toString() + ", Root: " + isRoot();
}
}
代码示例来源:origin: org.fourthline.cling/cling-core
public Resource[] getResources(Device device) throws ValidationException {
if (!device.isRoot()) return null;
Set<Resource> resources = new HashSet<>();
List<ValidationError> errors = new ArrayList<>();
log.fine("Discovering local resources of device graph");
Resource[] discoveredResources = device.discoverResources(this);
for (Resource resource : discoveredResources) {
log.finer("Discovered: " + resource);
if (!resources.add(resource)) {
log.finer("Local resource already exists, queueing validation error");
errors.add(new ValidationError(
getClass(),
"resources",
"Local URI namespace conflict between resources of device: " + resource
));
}
}
if (errors.size() > 0) {
throw new ValidationException("Validation of device graph failed, call getErrors() on exception", errors);
}
return resources.toArray(new Resource[resources.size()]);
}
代码示例来源:origin: org.fourthline.cling/cling-core
protected Collection<D> findEmbeddedDevices(D current) {
Collection<D> devices = new HashSet<>();
if (!current.isRoot() && current.getIdentity().getUdn() != null)
devices.add(current);
if (current.hasEmbeddedDevices()) {
for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
devices.addAll(findEmbeddedDevices(embeddedDevice));
}
}
return devices;
}
内容来源于网络,如有侵权,请联系作者删除!