1 28 29 package org.objectweb.util.explorer.core.code.lib; 30 31 import org.objectweb.util.explorer.ExplorerUtils; 32 import org.objectweb.util.explorer.core.code.api.CodeDescription; 33 import org.objectweb.util.explorer.core.common.api.Description; 34 35 43 public class BasicCodeDescription 44 implements CodeDescription 45 { 46 47 53 54 public String language_; 55 56 57 public String code_; 58 59 65 71 protected boolean equals(BasicCodeDescription codeDesc){ 72 return ExplorerUtils.compareObjects(language_, codeDesc.language_) 73 && ExplorerUtils.compareObjects(code_, codeDesc.code_); 74 } 75 76 82 85 public String getDescriptionType() { 86 return Description.CODE_DESCRIPTION; 87 } 88 89 92 public boolean isEmpty() { 93 return language_==null || language_.equals("") || code_==null || code_.equals(""); 94 } 95 96 102 105 public void setLanguage(String language) { 106 language_ = language; 107 } 108 109 112 public String getLanguage() { 113 return language_; 114 } 115 116 119 public void setCode(String code) { 120 code_ = code; 121 } 122 123 126 public String getCode() { 127 return code_; 128 } 129 130 136 140 public boolean equals(Object o){ 141 if(o!=null && o instanceof BasicCodeDescription){ 142 return equals((BasicCodeDescription)o); 143 } 144 return false; 145 } 146 147 151 public String toString(){ 152 return "BasicCodeDescription[" 153 + "language=" + ExplorerUtils.toString(language_) 154 + ", code=" + ExplorerUtils.toString(code_) 155 + "]"; 156 } 157 158 } | Popular Tags |