| Method from org.displaytag.properties.MediaTypeEnum Detail: |
public boolean equals(Object o) {
if (this == o)
{
return true;
}
return false;
}
Only a single instance of a specific MediaTypeEnum can be created, so we can check using ==. |
public static MediaTypeEnum fromCode(int key) {
// @todo optimization needed
for (int i = 0; i < ALL.size(); i++)
{
if (key == ((MediaTypeEnum) ALL.get(i)).getCode())
{
return (MediaTypeEnum) ALL.get(i);
}
}
// lookup failed
return null;
}
lookup a media type by key. |
public static MediaTypeEnum fromCode(Integer key) {
if (key == null)
{
return null;
}
return fromCode(key.intValue());
}
lookup a media type by an Integer key. |
public static MediaTypeEnum fromIntegerCode(Integer key) {
return fromCode(key);
} Deprecated! use - fromCode(Integer)
lookup a media type by an Integer key. |
public static MediaTypeEnum fromName(String code) {
// @todo optimization needed
for (int i = 0; i < ALL.size(); i++)
{
if (((MediaTypeEnum) ALL.get(i)).getName().equals(code))
{
return ((MediaTypeEnum) ALL.get(i));
}
}
// lookup failed
return null;
}
Lookup a media type by a String key. |
public int getCode() {
return this.enumCode;
}
|
public String getName() {
return this.enumName;
}
|
public static int getSize() {
return ALL.size();
}
Returns the number of media type currently loaded. |
public int hashCode() {
return new HashCodeBuilder(1188997057, -1289297553).append(this.enumCode).toHashCode();
}
|
public static Iterator iterator() {
return ALL.iterator();
}
returns an iterator on all the media type. |
public static synchronized MediaTypeEnum registerMediaType(String name) {
MediaTypeEnum existing = fromName(name);
if (existing == null)
{
existing = new MediaTypeEnum(ALL.size() + 1, name);
}
return existing;
}
Register a new MediaType. If name is already assigned the existing instance is returned, otherwise
a new instance is created. |
public String toString() {
return getName();
}
returns the media type description. |