1 6 7 package SOFA.SOFAnet.Admin.RMI; 8 9 import SOFA.SOFAnet.Repository.LocalInfo; 10 import java.io.Serializable ; 11 12 16 public class LocalInfoDesc implements Serializable , Comparable 17 { 18 public String bundleName; 19 public int state; 20 21 22 public LocalInfoDesc(LocalInfo localInfo) 23 { 24 bundleName = localInfo.getName(); 25 state = localInfo.getState(); 26 } 27 28 public LocalInfoDesc(String bundleName, int state) 29 { 30 this.bundleName = bundleName; 31 this.state = state; 32 } 33 34 public String toString() 35 { 36 return bundleName; 37 } 38 39 public boolean equals(Object o) 40 { 41 if (this == o) return true; 42 if (o instanceof LocalInfoDesc) 43 { 44 LocalInfoDesc localInfoDesc = (LocalInfoDesc)o; 45 return bundleName.compareTo(localInfoDesc.bundleName) == 0; 46 } 47 else return false; 48 } 49 50 public int compareTo(Object o) 51 { 52 LocalInfoDesc localInfoDesc = (LocalInfoDesc)o; 53 return bundleName.compareTo(localInfoDesc.bundleName); 54 } 55 56 57 public boolean isInstalled() 58 { 59 return (state & LocalInfo.STATE_INSTALLED) != 0; 60 } 61 62 public boolean isShareManager() 63 { 64 return (state & LocalInfo.STATE_SHARE_MANAGER) != 0; 65 } 66 67 public boolean isShareClient() 68 { 69 return (state & LocalInfo.STATE_SHARE_CLIENT) != 0; 70 } 71 72 public boolean areShareClientModes() 73 { 74 return (state & (LocalInfo.STATE_SHARE_CLIENT | LocalInfo.STATE_SHARE_PRECLIENT)) != 0; 75 } 76 77 public boolean isSharePreClient() 78 { 79 return (state & LocalInfo.STATE_SHARE_PRECLIENT) != 0; 80 } 81 82 public boolean isInSharing() 83 { 84 return (state & (LocalInfo.STATE_SHARE_MANAGER | LocalInfo.STATE_SHARE_CLIENT | LocalInfo.STATE_SHARE_PRECLIENT)) != 0; 85 } 86 87 } 88 | Popular Tags |