|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--antsim.impl.RandomResource
A RandomResource is characterized only by its name, which is
a string obtained from a long value generated randomly.
| Constructor Summary | |
RandomResource()
Construct a resource with a random name |
|
| Method Summary | |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one |
String |
getAttribute(String name)
Returns the value associated to the specified attribute name, or null if there is no attribute with that name.
|
long |
getContentLength()
Return the lenght of the content of the resource, if available; otherwise, it returns -1. |
InputStream |
getInputStream()
Return an input stream to download the contents of the resource. |
Object |
getKey()
Returns the key identifier of the object. |
String |
getName()
Returns the string identifier of the object. |
long |
size()
Return the space required to store the resource object. |
String |
toString()
Return a string representing this resource |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public RandomResource()
| Method Detail |
public Object getKey()
getKey in interface Resourcepublic String getName()
getName in interface Resourcepublic String getAttribute(String name)
null if there is no attribute with that name.
Implementation note: in this simple implementation, this
feature is not present; exception
UnsupportedOperationException is raised.
getAttribute in interface Resourcename - the name of the attributepublic InputStream getInputStream()
Implementation note: in this simple implementation, this
feature is not present; exception
UnsupportedOperationException is raised.
getInputStream in interface Resourcepublic long getContentLength()
Implementation note: in this simple implementation, this
feature is not present; exception
UnsupportedOperationException is raised.
getContentLength in interface Resourcepublic long size()
Resource
size in interface Resourcepublic String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||