1 11 package org.eclipse.jface.text.templates; 12 13 import java.util.ArrayList ; 14 import java.util.Arrays ; 15 import java.util.Collections ; 16 import java.util.List ; 17 18 import org.eclipse.core.runtime.Assert; 19 20 26 public final class TemplateVariableType { 27 28 29 private final String fName; 30 31 private final List fParams; 32 33 TemplateVariableType(String name) { 34 this(name, new String [0]); 35 } 36 37 TemplateVariableType(String name, String [] params) { 38 Assert.isLegal(name != null); 39 Assert.isLegal(params != null); 40 fName= name; 41 fParams= Collections.unmodifiableList(new ArrayList (Arrays.asList(params))); 42 } 43 44 49 public String getName() { 50 return fName; 51 } 52 53 58 public List getParams() { 59 return fParams; 60 } 61 62 65 public boolean equals(Object obj) { 66 if (obj instanceof TemplateVariableType) { 67 TemplateVariableType other= (TemplateVariableType) obj; 68 return other.fName.equals(fName) && other.fParams.equals(fParams); 69 } 70 return false; 71 } 72 73 76 public int hashCode() { 77 return fName.hashCode() + fParams.hashCode(); 78 } 79 80 84 public String toString() { 85 return fName + fParams.toString(); 86 } 87 } 88 | Popular Tags |