gumbo.util.relation
Class Relations

java.lang.Object
  |
  +--gumbo.util.relation.Relations

public final class Relations
extends java.lang.Object

Constants and utilities related to Relation.

Version:
$Revision: 1.2 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Nested Class Summary
static class Relations.RelationImm
          A serializable immutable view wrapper for a target Relation.
static class Relations.RelationWrapper
          A serializable wrapper for a target Relation.
 
Method Summary
static boolean isLive(Relation relation)
          Returns true if the relation is non-null and live (relationship is non-null).
static java.util.Collection relations(Relationship relationship, java.util.Collection delegators, java.util.Collection retVal)
          Gets the relations in a relationship corresponding to a group of delegators.
static java.util.List relations(Relationship relationship, java.util.List retVal)
          Replaces the delegators in a list with the corresponding relations in a relationship.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isLive

public static boolean isLive(Relation relation)
Returns true if the relation is non-null and live (relationship is non-null).

Parameters:
relation - The relation. Returns null if null.
Returns:
The result.

relations

public static java.util.Collection relations(Relationship relationship,
                                             java.util.Collection delegators,
                                             java.util.Collection retVal)
Gets the relations in a relationship corresponding to a group of delegators. The result may contain duplicates if the return collection is not a set.

Parameters:
relationship - The target relationship. Never null.
delegators - Collection of delegators (Object). Never null, all must be in the relationship.
retVal - Return value object. Collection of relations (Relation). Never null.
Returns:
Reference to retVal. Never null.

relations

public static java.util.List relations(Relationship relationship,
                                       java.util.List retVal)
Replaces the delegators in a list with the corresponding relations in a relationship.

Parameters:
relationship - The target relationship. Never null.
retVal - Input and return value object. Inputs delegators (Object). Outputs relations (Relation). Never null.
Returns:
Reference to retVal. Never null.