示例#1
0
 public synchronized void setSelfTrue(String deviceID) {
   for (DeviceInfoNode node : deviceList) {
     if (node.getDeviceID().equals(deviceID)) {
       node.setUpdated(DeviceInfoNode.Updated.TRUE);
     }
   }
 }
示例#2
0
 public DeviceInfoNode getServerNode(String deviceID) {
   for (DeviceInfoNode node : deviceList) {
     if (node.getDeviceID().equals(deviceID)) {
       return node;
     }
   }
   return null;
 }
示例#3
0
 public DeviceInfoNode getDeviceNode(String userName, String deviceID) {
   for (DeviceInfoNode node : deviceList) {
     if (node.getUserName().equals(userName) && node.getDeviceID().equals(deviceID)) {
       return node;
     }
   }
   return null;
 }
示例#4
0
  @Override
  public String toString() {
    String toString = fileName + "(" + userName + ")" + "\t";
    for (DeviceInfoNode node : deviceList) {
      toString += node.toString() + "\t";
    }

    return toString;
  }
示例#5
0
 /**
  * Constructor without userName
  *
  * @param fileName
  * @param deviceList
  */
 public FileDeviceList(
     String userName, String fileName, ArrayList<DeviceInfoNode> inputDeviceList) {
   //   this.deviceList = deviceList;
   for (DeviceInfoNode din : inputDeviceList) {
     DeviceInfoNode newDin = new DeviceInfoNode(din.getUserName(), din.getDeviceID());
     this.deviceList.add(newDin);
   }
   this.userName = userName;
   this.fileName = fileName;
 }
示例#6
0
 /**
  * Constructor with userName
  *
  * @param userName
  * @param deviceName
  * @param dl
  * @param fileName
  */
 public FileDeviceList(
     String userName, String deviceName, ArrayList<DeviceInfoNode> dl, String fileName) {
   this.userName = userName;
   this.fileName = fileName;
   this.deviceList = dl;
   for (DeviceInfoNode node : this.deviceList) {
     if (node.getDeviceID().equals(deviceName)) {
       node.setUpdated(DeviceInfoNode.Updated.TRUE);
     }
   }
 }