1 54 55 package org.apache.jetspeed.portlet; 56 57 import java.util.AbstractList ; 58 import java.util.LinkedList ; 59 60 73 74 public class Capability 75 { 76 private AbstractList impliedCapabilities = new LinkedList (); 77 78 private static AbstractList capabilities = new LinkedList (); 79 80 public final static Capability HTML_JAVA = new Capability ("HTML Java", 0); 81 public final static Capability HTML_JAVA_1_0 = new Capability ("HMTL Java 1.0", 1); 82 public final static Capability HTML_JAVA_1_1 = new Capability ("HTML Java 1.1", 2); 83 public final static Capability HTML_JAVA_1_2 = new Capability ("HTML Java 1.2", 3); 84 85 public final static Capability HTML_JAVASCRIPT = new Capability ("HTML JavaScript", 4); 86 public final static Capability HTML_JAVASCRIPT_1_0 = new Capability ("HTML JavaScript 1.0", 5); 87 public final static Capability HTML_JAVASCRIPT_1_1 = new Capability ("HTML JavaScript 1.1", 6); 88 public final static Capability HTML_JAVASCRIPT_1_2 = new Capability ("HTML JavaScript 1.2", 7); 89 90 public final static Capability HTML_TABLE = new Capability ("HTML Table Support", 8); 91 public final static Capability HTML_NESTED_TABLE = new Capability ("HTML Nested Table Support", 9); 92 93 public final static Capability HTML_FORM = new Capability ("HTML Forms Support", 10); 94 95 public final static Capability HTML_FRAME = new Capability ("HTML Frames Support", 11); 96 97 public final static Capability HTML_IMAGE = new Capability ("HTML Images Support", 12); 98 99 public final static Capability HTML_ACTIVE_X = new Capability ("HTML Active X", 13); 100 101 public final static Capability HTML_CSS1 = new Capability ("HTML CSS1 Support", 14); 102 public final static Capability HTML_CSS2 = new Capability ("HTML CSS2 Support", 15); 103 public final static Capability HTML_CSSP = new Capability ("HTML CSSP Support", 16); 104 105 public final static Capability WML_TABLE = new Capability ("WML Table Support", 17); 106 107 public final static Capability HTTP_COOKIE = new Capability ("HTTP Cookie Support", 18); 108 109 static 110 { 111 HTML_JAVASCRIPT_1_0.implies (HTML_JAVASCRIPT); 112 HTML_JAVASCRIPT_1_1.implies (HTML_JAVASCRIPT); 113 HTML_JAVASCRIPT_1_2.implies (HTML_JAVASCRIPT); 114 115 HTML_JAVA_1_0.implies (HTML_JAVA); 116 HTML_JAVA_1_1.implies (HTML_JAVA); 117 HTML_JAVA_1_2.implies (HTML_JAVA); 118 119 } 121 122 127 128 public int hashCode () 129 { 130 return (value); 131 } 132 133 143 144 public boolean equals (Object object) 145 { 146 boolean result = false; 147 148 if (object instanceof Capability) 149 { 150 result = (this.getClass () == object.getClass () && 151 this.getValue () == ((Capability) object).getValue ()); 152 } 153 154 return (result); 155 } 156 157 162 163 public String toString () 164 { 165 return (identifier); 166 } 167 168 173 174 public String getIdentifier () 175 { 176 return (identifier); 177 } 178 179 184 185 protected int getValue () 186 { 187 return (value); 188 } 189 190 private String identifier; 191 192 private int value; 193 194 202 203 private Capability (String identifier, int value) 204 { 205 this.identifier = identifier; 206 this.value = value; 207 208 capabilities.add (this); 209 } 210 211 217 218 private void implies (Capability capability) 219 { 220 impliedCapabilities.add (capability); 221 } 222 } 223 224 | Popular Tags |