|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Document.Image
public abstract class Image
Abstract class representing an image as a list of regions
Field Summary | |
---|---|
protected ImageID |
ID
The ID of this image |
protected java.util.AbstractList<Region> |
regions
The list of regions of the image |
protected int |
size
The number of pixels in this image |
Constructor Summary | |
---|---|
Image(ImageID id)
Creates an image with a particular ID. |
Method Summary | |
---|---|
void |
deleteRegionAt(int num)
Removes the num-th region of an image. |
void |
deleteRegionID(ImageID num)
Removes an image region having a particular ID. |
abstract double |
distance(Image i)
Abstract method for computing the distance to another image. |
ImageID |
getID()
Returns the image ID. |
int |
getNumRegions()
Returns the number of regions in this image. |
Region |
getRegionAt(int num)
Returns the num-th region of an image. |
Region |
getRegionID(ImageID id)
Retrieves the image region with a particular ID. |
int |
getSize()
Returns the size of the image (i.e., its total number of pixels). |
protected void |
setSize(int s)
Modifies the size of the image (i.e., its total number of pixels). |
java.lang.String |
toString()
Returns an array of Strings representing features of image regions together with other image information. |
abstract java.lang.String[] |
toStrings()
Returns an array of Strings representing features of image regions together with other image information. |
protected void |
updateSize()
Updates the size of the image as the sum of sizes of its regions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ImageID ID
protected java.util.AbstractList<Region> regions
protected int size
Constructor Detail |
---|
public Image(ImageID id)
id
- ID of the image.Method Detail |
---|
public Region getRegionID(ImageID id)
id
- ID of the region to be returned.
public Region getRegionAt(int num)
num
- The position of the region to be returned.
null
if no such region exists).public ImageID getID()
public int getNumRegions()
public int getSize()
protected void setSize(int s)
s
- the size of the image.protected void updateSize()
public void deleteRegionAt(int num)
num
- the position of the region to be removed.
java.lang.IndexOutOfBoundsException
- if num is out of range.public void deleteRegionID(ImageID num)
num
- ID of the region to be removed.public abstract java.lang.String[] toStrings()
public java.lang.String toString()
toString
in class java.lang.Object
public abstract double distance(Image i)
i
- Image to be compared.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |