Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 package com.github.rosjava.android_remocons.common_tools.master;
00036
00037 import java.util.Date;
00038 import java.util.List;
00039
00046 public class RoconDescription extends MasterDescription implements java.io.Serializable {
00047 private static final long serialVersionUID = -4705526306056241179L;
00048
00049 private String description;
00050 private String[] userRoles;
00051 private int currentRole = -1;
00052 private String interactionsNamespace;
00053
00054 public static RoconDescription create(MasterDescription master) {
00055 RoconDescription cd = new RoconDescription(master.getMasterId(), master.getMasterName(),
00056 null, null, null, new Date());
00057 cd.setMasterIconFormat(master.getMasterIconFormat());
00058 cd.setMasterIconData(master.getMasterIconData());
00059 return cd;
00060 }
00061
00062 public static RoconDescription createUnknown(MasterId masterId) {
00063 return new RoconDescription(masterId, NAME_UNKNOWN, null, null, null, new Date());
00064 }
00065
00069 public RoconDescription() {
00070 }
00071
00072 public RoconDescription(MasterId masterId, String concertName, String description,
00073 rocon_std_msgs.Icon concertIcon, String interactionsNamespace,
00074 Date timeLastSeen) {
00075 super(masterId, concertName, "Rocon concert", concertIcon, "", timeLastSeen);
00076
00077 this.description = description;
00078 this.interactionsNamespace = interactionsNamespace;
00079 }
00080
00081 public void copyFrom(RoconDescription other) {
00082 super.copyFrom(other);
00083
00084 this.userRoles = other.userRoles.clone();
00085 this.description = other.description;
00086 this.interactionsNamespace = other.interactionsNamespace;
00087 }
00088
00089 public String getInteractionsNamespace() { return this.interactionsNamespace; }
00090
00091 public String[] getUserRoles() {
00092 return userRoles;
00093 }
00094
00095 public String getCurrentRole() {
00096 if (userRoles != null && currentRole >= 0 && currentRole < userRoles.length)
00097 return userRoles[currentRole];
00098 else
00099 return null;
00100 }
00101
00102 public void setInteractionsNamespace(String namespace) {
00103 this.interactionsNamespace = namespace;
00104 }
00105
00106 public void setUserRoles(List<String> roles)
00107 {
00108 userRoles = new String[roles.size()];
00109 roles.toArray(userRoles);
00110 }
00111 public void setCurrentRole(int role) {
00112 currentRole = role;
00113 }
00114 }