|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.tools.Resource
public class Resource
This represents a resource obtained from a URL or File.
Field Summary | |
---|---|
protected static java.lang.String |
encoding
|
Constructor Summary | |
---|---|
Resource(java.io.File file)
Constructs a resource from a file. |
|
Resource(java.net.URL url)
Constructs a resource from a url. |
Method Summary | |
---|---|
java.lang.String |
getAbsolutePath()
Gets the absolute path. |
java.applet.AudioClip |
getAudioClip()
Gets an AudioClip. |
java.awt.image.BufferedImage |
getBufferedImage()
Gets a buffered image. |
java.io.File |
getFile()
Gets the file associated with this resource. |
javax.swing.ImageIcon |
getIcon()
Gets an ImageIcon. |
java.awt.Image |
getImage()
Gets an Image. |
java.lang.Object |
getObject(java.lang.Class<?> type)
Gets an object of the specified type. |
java.lang.String |
getString()
Gets a String. |
java.net.URL |
getURL()
Gets the url associated with this resource. |
java.io.InputStream |
openInputStream()
Opens an InputStream. |
java.io.BufferedReader |
openReader()
Opens a BufferedReader. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.lang.String encoding
Constructor Detail |
---|
public Resource(java.net.URL url)
url
- the URLpublic Resource(java.io.File file)
file
- the fileMethod Detail |
---|
public java.lang.String getAbsolutePath()
public java.net.URL getURL()
public java.io.File getFile()
public java.lang.Object getObject(java.lang.Class<?> type)
type
- the desired class type
public java.io.InputStream openInputStream()
public java.io.BufferedReader openReader()
public javax.swing.ImageIcon getIcon()
public java.awt.Image getImage()
public java.awt.image.BufferedImage getBufferedImage()
public java.lang.String getString()
public java.applet.AudioClip getAudioClip()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |