Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

org.alfresco.service.cmr.repository
Class ChildAssociationRef
java.lang.Object
  org.alfresco.service.cmr.repository.ChildAssociationRef
All Implemented Interfaces:
EntityRef, Comparable<ChildAssociationRef>, Serializable

public class ChildAssociationRef
extends Object
implements EntityRef, Comparable<ChildAssociationRef>, Serializable
This class represents a child relationship between two nodes. This relationship is named.

So it requires the parent node ref, the child node ref and the name of the child within the particular parent.

This combination is not a unique identifier for the relationship with regard to structure. In use this does not matter as we have no concept of order, particularly in the index.

Author:
andyh
See Also:
Serialized Form

Constructor Summary
ChildAssociationRef(String childAssocRefStr)
ChildAssociationRef(QName assocTypeQName, NodeRef parentRef, QName childQName, NodeRef childRef)
          Constructs a non-primary, -1th sibling parent-child association reference.
ChildAssociationRef(QName assocTypeQName, NodeRef parentRef, QName childQName, NodeRef childRef, boolean isPrimary, int nthSibling)
          Construct a representation of a parent --- name ----> child relationship.
Method Summary
int
compareTo(ChildAssociationRef another)
boolean
equals(Object o)
          Compares: assocTypeQName parentRef childRef childQName
getChildRef()
int
getNthSibling()
getParentRef()
getQName()
          Get the qualified name of the parent-child association
getTypeQName()
          Get the qualified name of the association type
int
hashCode()
boolean
isPrimary()
void
setNthSibling(int nthSibling)
          Allows post-creation setting of the ordering index.
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Constructor Detail
ChildAssociationRef
public ChildAssociationRef(QName assocTypeQName,
                           NodeRef parentRef,
                           QName childQName,
                           NodeRef childRef,
                           boolean isPrimary,
                           int nthSibling)
Construct a representation of a parent --- name ----> child relationship.
Parameters:
assocTypeQName - the type of the association
parentRef - the parent reference - may be null
childQName - the qualified name of the association - may be null
childRef - the child node reference. This must not be null.
isPrimary - true if this represents the primary parent-child relationship
nthSibling - the nth association with the same properties. Usually -1 to be ignored.

ChildAssociationRef
public ChildAssociationRef(QName assocTypeQName,
                           NodeRef parentRef,
                           QName childQName,
                           NodeRef childRef)
Constructs a non-primary, -1th sibling parent-child association reference.
See Also:
ChildAssociationRef(org.alfresco.service.namespace.QName, NodeRef, org.alfresco.service.namespace.QName, NodeRef)

ChildAssociationRef
public ChildAssociationRef(String childAssocRefStr)
Parameters:
childAssocRefStr - a string of the form parentNodeRef|childNodeRef|assocTypeQName|assocQName|isPrimary|nthSibling
Method Detail
toString
public String toString()
Overrides:
toString in class Object
Returns:
Returns a string of the form parentNodeRef|childNodeRef|assocTypeQName|assocQName|isPrimary|nthSibling

equals
public boolean equals(Object o)
Compares:
  • assocTypeQName
  • parentRef
  • childRef
  • childQName
Overrides:
equals in class Object

hashCode
public int hashCode()
Overrides:
hashCode in class Object

compareTo
public int compareTo(ChildAssociationRef another)
Specified by:
compareTo in interface Comparable<T>
See Also:
setNthSibling(int)

getTypeQName
public QName getTypeQName()
Get the qualified name of the association type
Returns:
Returns the qualified name of the parent-child association type as defined in the data dictionary. It may be null if this is the imaginary association to the root node.

getQName
public QName getQName()
Get the qualified name of the parent-child association
Returns:
Returns the qualified name of the parent-child association. It may be null if this is the imaginary association to a root node.

getChildRef
public NodeRef getChildRef()
Returns:
Returns the child node reference - never null

getParentRef
public NodeRef getParentRef()
Returns:
Returns the parent node reference, which may be null if this represents the imaginary reference to the root node

isPrimary
public boolean isPrimary()
Returns:
Returns true if this represents a primary association

getNthSibling
public int getNthSibling()
Returns:
Returns the nth sibling required

setNthSibling
public void setNthSibling(int nthSibling)
Allows post-creation setting of the ordering index. This is a helper so that sorted sets and lists can be easily sorted.

This index is in no way absolute and should change depending on the results that appear around this instance. Therefore, the sibling number cannot be used to construct, say, sibling number 5. Sibling number 5 will exist only in results where there are siblings 1 - 4.

Parameters:
nthSibling - the sibling index

Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005–2016 Alfresco Software. All rights reserved.

Java API documentation generated with DocFlex/Javadoc 1.6.1 using JavadocPro template set.