|
|||||||||||
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 Resource
public String getName()
getName
in interface Resource
public 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 Resource
name
- 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 Resource
public long getContentLength()
Implementation note: in this simple implementation, this
feature is not present; exception
UnsupportedOperationException
is raised.
getContentLength
in interface Resource
public long size()
Resource
size
in interface Resource
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |