org.fourthline.cling.model.meta.Device.find()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.fourthline.cling.model.meta.Device.find()方法的一些代码示例,展示了Device.find()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.find()方法的具体详情如下:
包路径:org.fourthline.cling.model.meta.Device
类名称:Device
方法名:find

Device.find介绍

暂无

代码示例

代码示例来源:origin: 4thline/cling

public D[] findDevices(ServiceType serviceType) {
  return toDeviceArray(find(serviceType, (D) this));
}

代码示例来源:origin: 4thline/cling

public D[] findDevices(DeviceType deviceType) {
  return toDeviceArray(find(deviceType, (D) this));
}

代码示例来源:origin: 4thline/cling

protected Collection<D> find(DeviceType deviceType, D current) {
  Collection<D> devices = new HashSet<>();
  // Type might be null if we just discovered the device and it hasn't yet been hydrated
  if (current.getType() != null && current.getType().implementsVersion(deviceType)) {
    devices.add(current);
  }
  if (current.hasEmbeddedDevices()) {
    for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
      devices.addAll(find(deviceType, embeddedDevice));
    }
  }
  return devices;
}

代码示例来源:origin: 4thline/cling

protected D find(UDN udn, D current) {
  if (current.getIdentity() != null && current.getIdentity().getUdn() != null) {
    if (current.getIdentity().getUdn().equals(udn)) return current;
  }
  if (current.hasEmbeddedDevices()) {
    for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
      D match;
      if ((match = find(udn, embeddedDevice)) != null) return match;
    }
  }
  return null;
}

代码示例来源:origin: kingthy/TVRemoteIME

public D[] findDevices(ServiceType serviceType) {
  return toDeviceArray(find(serviceType, (D) this));
}

代码示例来源:origin: kingthy/TVRemoteIME

public D[] findDevices(DeviceType deviceType) {
  return toDeviceArray(find(deviceType, (D) this));
}

代码示例来源:origin: kingthy/TVRemoteIME

protected Collection<D> find(DeviceType deviceType, D current) {
  Collection<D> devices = new HashSet();
  // Type might be null if we just discovered the device and it hasn't yet been hydrated
  if (current.getType() != null && current.getType().implementsVersion(deviceType)) {
    devices.add(current);
  }
  if (current.hasEmbeddedDevices()) {
    for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
      devices.addAll(find(deviceType, embeddedDevice));
    }
  }
  return devices;
}

代码示例来源:origin: kingthy/TVRemoteIME

protected D find(UDN udn, D current) {
  if (current.getIdentity().getUdn().equals(udn)) return current;
  if (current.hasEmbeddedDevices()) {
    for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
      D match;
      if ((match = find(udn, embeddedDevice)) != null) return match;
    }
  }
  return null;
}

代码示例来源:origin: org.fourthline.cling/cling-core

public D[] findDevices(ServiceType serviceType) {
  return toDeviceArray(find(serviceType, (D) this));
}

代码示例来源:origin: org.fourthline.cling/cling-core

public D[] findDevices(DeviceType deviceType) {
  return toDeviceArray(find(deviceType, (D) this));
}

代码示例来源:origin: org.fourthline.cling/cling-core

protected Collection<D> find(DeviceType deviceType, D current) {
  Collection<D> devices = new HashSet<>();
  // Type might be null if we just discovered the device and it hasn't yet been hydrated
  if (current.getType() != null && current.getType().implementsVersion(deviceType)) {
    devices.add(current);
  }
  if (current.hasEmbeddedDevices()) {
    for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
      devices.addAll(find(deviceType, embeddedDevice));
    }
  }
  return devices;
}

代码示例来源:origin: org.fourthline.cling/cling-core

protected D find(UDN udn, D current) {
  if (current.getIdentity() != null && current.getIdentity().getUdn() != null) {
    if (current.getIdentity().getUdn().equals(udn)) return current;
  }
  if (current.hasEmbeddedDevices()) {
    for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
      D match;
      if ((match = find(udn, embeddedDevice)) != null) return match;
    }
  }
  return null;
}

相关文章