|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--anthill.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(java.lang.Object obj)
Indicates whether some other object is "equal to" this one |
java.lang.String |
getAttribute(java.lang.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. |
java.io.InputStream |
getInputStream()
Return an input stream to download the contents of the resource. |
java.lang.String |
getName()
Returns the string identifier of the object. |
java.lang.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 java.lang.String getName()
getName
in interface Resource
public java.lang.String getAttribute(java.lang.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 java.io.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 java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |