Resourcepublic class Resource extends Object Wrapper around any object to allow store it as resource in ResourceCache.
HashCode of the Resource instance has to be replaced with precalculated
integer value this is key in the cache. ResourceCache itself is responsible
for calculating hash code {@link ResourceCache#getHashCodeForResource}. It
is always calculated from basename, locale, and id. |
Fields Summary |
---|
private int | codeHashcode identifying instance in cache | private int | sizeSize of the object to store | private Object | valueDescription of the data to store in cache |
Constructors Summary |
---|
public Resource(int code, int size, Object value)Creates Resource initialized.
this.code = code;
this.size = size;
this.value = value;
|
Methods Summary |
---|
public boolean | equals(java.lang.Object o)Resources are compared using code field.
if (o instanceof Resource) {
return ((Resource) o).getCode() == code;
}
return false;
| public int | getCode()get code of this resource.
return code;
| public int | getSize()get size of the resource instance.
return size;
| public java.lang.Object | getValue()Get data stored under this resource.
return value;
| public int | hashCode()get hash code of this instance.
return code;
|
|