com.vinculumtech.carrierwave.source
Class RespectiveImageGraph

java.lang.Object
  extended bycom.vinculumtech.carrierwave.image.ImageGraph
      extended bycom.vinculumtech.carrierwave.source.SourcedImageGraph
          extended bycom.vinculumtech.carrierwave.source.RespectiveImageGraph
All Implemented Interfaces:
java.io.Serializable

public class RespectiveImageGraph
extends SourcedImageGraph

A RespectiveImageGraph manages to keep Image instances in their respective partition. If an Image instance is added to a RespectiveImageGraph, it will remain there. If a child is added to an Image that belongs to a RespectiveImageGraph, and it is not a RespectiveImageGraph instance, it will be added. But if the child belongs to another RespectiveImageGraph, it will not be added, nor will the contents of this RespectiveImageGraph be added to it.

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/carrierwave/source/RespectiveImageGraph.java#5 $
See Also:
Serialized Form

Constructor Summary
  RespectiveImageGraph()
          Create a new RespectiveImageGraph.
  RespectiveImageGraph(ImageSource imageSource)
          Create a new RespectiveImageGraph.
protected RespectiveImageGraph(ImageSource imageSource, ImageGraph imageGraph)
           
 
Method Summary
protected  void associateImage(Image image)
          Adds the given Image instance to the current ImageGraph if it is not already a member.
It is assumed the given image is intended as a child to an Image existing in this ImageGraph.
protected  void associateImageGraphs(ImageGraph imageGraph)
          Handles the association between this ImageGraph instance and the given child ImageGraph instance (associated with an Image added via associateImage)
It is intended that this method be overidden for special cases.
protected  void disassociateImage(Image image)
          Disassociates the given Image image from the graph.
It is assumed the given Image instance has lost a parent child relationship with an Image in this ImageGraph instance.
Note that disassociation does not remove the Image instance, but simply decrements its reference count.
 Image getImage(Icon icon)
          Return an Image for the given icon, or null if none can be found.
 
Methods inherited from class com.vinculumtech.carrierwave.source.SourcedImageGraph
getImageSource, setImageSource, writeReplace
 
Methods inherited from class com.vinculumtech.carrierwave.image.ImageGraph
acceptImage, addImagesFrom, addImagesTo, addOriginImage, becomeImageGraph, clear, clearOriginImages, containsImage, decrementImage, disassociateImage, getIcons, getImageLocal, getImageMap, getImages, getImagesPrivate, getOriginImage, getOriginImages, getOriginsPrivate, hasManyOriginImages, incrementImage, isDurable, isStrict, makeDurable, makeOriginImage, makeOriginImages, makeStrict, putImage, reassociateImage, removeImage, removeOrigin, setDurable, setIsStrict, setThisOnAll, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RespectiveImageGraph

public RespectiveImageGraph()
Create a new RespectiveImageGraph.


RespectiveImageGraph

public RespectiveImageGraph(ImageSource imageSource)
Create a new RespectiveImageGraph.


RespectiveImageGraph

protected RespectiveImageGraph(ImageSource imageSource,
                               ImageGraph imageGraph)
Method Detail

getImage

public Image getImage(Icon icon)
Return an Image for the given icon, or null if none can be found.

Overrides:
getImage in class SourcedImageGraph
Parameters:
icon -
Returns:
the Image instance identified by the given Icon instance

disassociateImage

protected void disassociateImage(Image image)
Description copied from class: ImageGraph
Disassociates the given Image image from the graph.
It is assumed the given Image instance has lost a parent child relationship with an Image in this ImageGraph instance.
Note that disassociation does not remove the Image instance, but simply decrements its reference count. If the reference count becomes zero, the Image instance becomes an origin.
It is intended for this method to be called by subclasses of Image.

Overrides:
disassociateImage in class ImageGraph
Parameters:
image -

associateImageGraphs

protected void associateImageGraphs(ImageGraph imageGraph)
Description copied from class: ImageGraph
Handles the association between this ImageGraph instance and the given child ImageGraph instance (associated with an Image added via associateImage)
It is intended that this method be overidden for special cases.

Overrides:
associateImageGraphs in class ImageGraph
Parameters:
imageGraph -

associateImage

protected void associateImage(Image image)
Description copied from class: ImageGraph
Adds the given Image instance to the current ImageGraph if it is not already a member.
It is assumed the given image is intended as a child to an Image existing in this ImageGraph. Thus, the image will have its reference count increased. And it will no longer be considered an origin, if it was one previously.
Note that the child ImageGraph instance (if any) the given Image instance currently belongs to, will have all of its images instances assumed this ImageGraph.
It is intended for this method to be called by subclasses of Image.

Overrides:
associateImage in class ImageGraph
Parameters:
image -


Copyright (C) 2002 Vinculum Technologies, Inc. All Rights Reserved.