com.flexive.shared.structure
Class FxTypeRelation

java.lang.Object
  extended by com.flexive.shared.structure.FxTypeRelation
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FxTypeRelationEdit

public class FxTypeRelation
extends java.lang.Object
implements java.io.Serializable

Extension of FxType to hold relation mappings

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
protected  long maxDestination
           
protected  long maxSource
           
 
Constructor Summary
FxTypeRelation(FxType source, FxType destination, long maxSource, long maxDestination)
          Constructor, only used internally.
 
Method Summary
 FxTypeRelationEdit asEditable()
          Get this FxTypeRelation as editable
 boolean equals(java.lang.Object o)
          Overrides Objet's eqials method.
 boolean equalsCompletely(java.lang.Object o)
           
 FxType getDestination()
          Get the destination FxType
 long getMaxDestination()
          Get the maximum number of allowed destination instances, unlimited if 0
 long getMaxSource()
          Get the maximum number of allowed source instances, unlimited if 0
 FxType getSource()
          Get the source FxType
 int hashCode()
           
 boolean isDestinationLimited()
          Is there a limit on destination instances?
 boolean isSourceLimited()
          Is there a limit on source instances?
 void resolveReferences(FxEnvironment env)
          Resolve references after initial loading
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxSource

protected long maxSource

maxDestination

protected long maxDestination
Constructor Detail

FxTypeRelation

public FxTypeRelation(FxType source,
                      FxType destination,
                      long maxSource,
                      long maxDestination)
Constructor, only used internally. Update relation mappings using FxTypeEdit!

Parameters:
source - source type
destination - destination type
maxSource - maximum number of allowed source instances, unlimited if 0
maxDestination - maximum number of allowed destination instances, unlimited if 0
Method Detail

getSource

public FxType getSource()
Get the source FxType

Returns:
Source FxType

getDestination

public FxType getDestination()
Get the destination FxType

Returns:
Destination FxType

getMaxSource

public long getMaxSource()
Get the maximum number of allowed source instances, unlimited if 0

Returns:
maximum number of allowed source instances, unlimited if 0

getMaxDestination

public long getMaxDestination()
Get the maximum number of allowed destination instances, unlimited if 0

Returns:
maximum number of allowed destination instances, unlimited if 0

isSourceLimited

public boolean isSourceLimited()
Is there a limit on source instances?

Returns:
limit on source instances?

isDestinationLimited

public boolean isDestinationLimited()
Is there a limit on destination instances?

Returns:
limit on destination instances?

resolveReferences

public void resolveReferences(FxEnvironment env)
                       throws FxNotFoundException
Resolve references after initial loading

Parameters:
env - env
Throws:
FxNotFoundException - on errors

asEditable

public FxTypeRelationEdit asEditable()
Get this FxTypeRelation as editable

Returns:
FxTypeRelationEdit

equals

public boolean equals(java.lang.Object o)
Overrides Objet's eqials method. Compares two relations for same source and destination, comparing multiplicites is intentionally neglected

Overrides:
equals in class java.lang.Object
Returns:
this.getSource().getId() == other.getSource().getId() && this.getDestination().getId() == other.getDestination().getId()

hashCode

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

equalsCompletely

public boolean equalsCompletely(java.lang.Object o)