org.gcube.contentmanagement.gcubemodellibrary.elements
Class GCubeAnnotation

java.lang.Object
  extended by org.gcube.contentmanagement.gcubemodellibrary.elements.BaseElement
      extended by org.gcube.contentmanagement.gcubemodellibrary.elements.BaseInnerElement
          extended by org.gcube.contentmanagement.gcubemodellibrary.elements.GCubeAnnotation
All Implemented Interfaces:
GCubeElement, GCubeInnerElement

public class GCubeAnnotation
extends BaseInnerElement

An annotation for a GCubeDocument.

Author:
Federico De Faveri defaveri@isti.cnr.it, Fabio Simeoni (University of Strathclyde)

Constructor Summary
GCubeAnnotation()
          Creates an instance.
GCubeAnnotation(java.lang.String id)
          Creates an instance that act as a proxy for a given annotation.
 
Method Summary
 void _setPrevious(GCubeAnnotation a)
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 void postBinding(GCubeDocument d)
          
 GCubeAnnotation previous()
          Returns the annotation that precedes this annotation in an annotation thread, if available in the containing document.
 java.lang.String previousID()
          Returns the identifier of the annotation that precedes this element in an annotation thread.
 void setPrevious(GCubeAnnotation a)
          Sets the annotation that precedes this annotation in an annotation thread.
 java.lang.String toString()
          
 
Methods inherited from class org.gcube.contentmanagement.gcubemodellibrary.elements.BaseInnerElement
document, uri
 
Methods inherited from class org.gcube.contentmanagement.gcubemodellibrary.elements.BaseElement
addProperty, bytestream, bytestreamURI, creationTime, id, isNew, language, lastUpdate, length, mimeType, name, properties, property, removeProperty, resolveBytestream, schemaName, schemaURI, setBytestream, setBytestream, setBytestream, setBytestreamURI, setLanguage, setLenght, setMimeType, setName, setSchemaName, setSchemaURI, setType, type
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.gcube.contentmanagement.gcubemodellibrary.elements.GCubeElement
bytestream, bytestreamURI, creationTime, id, language, lastUpdate, length, mimeType, name, properties, property, resolveBytestream, schemaName, schemaURI, type
 

Constructor Detail

GCubeAnnotation

public GCubeAnnotation()
Creates an instance.


GCubeAnnotation

public GCubeAnnotation(java.lang.String id)
Creates an instance that act as a proxy for a given annotation.

Parameters:
id - the annotation identifier.
Method Detail

postBinding

public void postBinding(GCubeDocument d)
                 throws java.lang.IllegalStateException,
                        java.lang.Exception

Overrides:
postBinding in class BaseInnerElement
Throws:
java.lang.IllegalStateException
java.lang.Exception

setPrevious

public void setPrevious(GCubeAnnotation a)
                 throws java.lang.IllegalStateException,
                        java.lang.IllegalArgumentException
Sets the annotation that precedes this annotation in an annotation thread.

Parameters:
a - the previous annotation, or null to unlink this annotation from any other.
Throws:
java.lang.IllegalStateException - if this annotation is not associated with a document or is a proxy of an existing annotation.
java.lang.IllegalArgumentException - if the input annotation is new or is bound to a different document than this annotation's.

_setPrevious

public void _setPrevious(GCubeAnnotation a)

previous

public GCubeAnnotation previous()
Returns the annotation that precedes this annotation in an annotation thread, if available in the containing document.

Returns:
the previous part, or null if this annotation does not follow another in an annotation thread or if it does but is not available in the containing document.

previousID

public java.lang.String previousID()
Returns the identifier of the annotation that precedes this element in an annotation thread.

Returns:
the identifier, or null if this annotation does not follow another in an annotation thread.

toString

public java.lang.String toString()

Overrides:
toString in class BaseElement

hashCode

public int hashCode()
Overrides:
hashCode in class BaseElement

equals

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