org.imemex.contentconverters
Class AbstractHierarchicalContentConvertedResourceView

java.lang.Object
  extended by org.imemex.contentconverters.AbstractHierarchicalContentConvertedResourceView
All Implemented Interfaces:
java.lang.Comparable<ContentConvertedResourceView>, ContentConvertedResourceView, ResourceView
Direct Known Subclasses:
DefaultHierarchicalContentConvertedResourceView

public abstract class AbstractHierarchicalContentConvertedResourceView
extends java.lang.Object
implements ContentConvertedResourceView, java.lang.Comparable<ContentConvertedResourceView>

This class implements a resource view plugin id scheme in which the plugin id of a view is given by a concatenation of the plugin id from its parent view with a suffix. Note that this works on resource view graphs that are tree-shaped. To avoid unnecessary repetition of the prefix in all views that are indirectly to a given start view, we do not store the whole id on each view explicitly, but rather compute it when necessary based on the top-level views' plugin ids. Note that this scheme helps save main memory for the object representation of a resource view graph. The storage of plugin ids in the catalog may, however, remain using the innefficient alternative of storing all prefixes many times. NOTE: the ids assigned in this scheme are not updateable for now. That is done to avoid performance issues on computation that needs to unroll the id, such as hashCode.

This abstract implementation provides

Author:
marcos

Constructor Summary
AbstractHierarchicalContentConvertedResourceView(AbstractHierarchicalContentConvertedResourceView parent, java.lang.String relativeContentConvertedId, java.lang.String name)
          Instantiates a new AbstractHierarchicalPluginIdentifiableResourceView providing all possible parameters.
AbstractHierarchicalContentConvertedResourceView(java.lang.String relativeContentConvertedId, java.lang.String name)
          Instantiates a new AbstractHierarchicalPluginIdentifiableResourceView which has no parent.
 
Method Summary
 int compareTo(ContentConvertedResourceView rv)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getContentConvertedId()
          Collect and concatenate the content converted IDs of this resource view and all the resource views higher in the content conversion hierarchy.
 java.lang.String getName()
          gets the Name component eta of this resource view
 int hashCode()
           
 java.lang.String toString()
          Concatenate content converted ID of this resource view with the string returned when calling Object.toString().
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.imemex.idm.ResourceView
getContent, getGroup, getTuple
 

Constructor Detail

AbstractHierarchicalContentConvertedResourceView

public AbstractHierarchicalContentConvertedResourceView(java.lang.String relativeContentConvertedId,
                                                        java.lang.String name)
Instantiates a new AbstractHierarchicalPluginIdentifiableResourceView which has no parent.

Parameters:
relativeContentConvertedId - the relative content converted ID to use.
name - the name for this resource view.

AbstractHierarchicalContentConvertedResourceView

public AbstractHierarchicalContentConvertedResourceView(AbstractHierarchicalContentConvertedResourceView parent,
                                                        java.lang.String relativeContentConvertedId,
                                                        java.lang.String name)
Instantiates a new AbstractHierarchicalPluginIdentifiableResourceView providing all possible parameters.

Parameters:
parent - parent resource view of this resource view.
relativeContentConvertedId - the relative content converted ID to use.
name - the name for this resource view.
Method Detail

getName

public java.lang.String getName()
Description copied from interface: ResourceView
gets the Name component eta of this resource view

Specified by:
getName in interface ResourceView
Returns:
name as String

getContentConvertedId

public java.lang.String getContentConvertedId()
Collect and concatenate the content converted IDs of this resource view and all the resource views higher in the content conversion hierarchy.

Specified by:
getContentConvertedId in interface ContentConvertedResourceView
Parameters:
the - content converted ID of this resource view.
Returns:
content converted ID.

compareTo

public int compareTo(ContentConvertedResourceView rv)
Specified by:
compareTo in interface java.lang.Comparable<ContentConvertedResourceView>

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Concatenate content converted ID of this resource view with the string returned when calling Object.toString().

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()