LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.misc
Class LyDependencies

java.lang.Object
  extended by leon.misc.LyDependencies

public final class LyDependencies
extends java.lang.Object

This class is a utility class that manages dependencies between objects. An object may be associated with a list of objects. These dependencies could be represented by symmetrical links between these objects.


Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LyDependencies()
          Constructor with no parameter.
 
Method Summary
 void addDepend(java.lang.Object object1, java.lang.Object object2)
          Adds a dependency between the two given objects.
 boolean contains(java.lang.Object object)
          Checks if the given object is contained in the dependencies.
 java.util.Vector<java.lang.Object> getDepends(java.lang.Object object)
          Gets objects linked to the given object.
 int getSize()
          Gets the number of dependencies between objects contained in this instance of LyDependencies.
 java.util.Enumeration<java.lang.Object> keys()
          Gets the keys list of dependencies defined in this object.
 void removeObject(java.lang.Object object)
          Removes all occurences of the given object in the dependencies.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyDependencies

public LyDependencies()
Constructor with no parameter. Initializes _depends to null.

Method Detail

contains

public boolean contains(java.lang.Object object)
Checks if the given object is contained in the dependencies.

Parameters:
object - The object to find.
Returns:
true if the given object is found, false otherwise.

addDepend

public void addDepend(java.lang.Object object1,
                      java.lang.Object object2)
Adds a dependency between the two given objects.

Parameters:
object1 - The first object of the dependency.
object2 - The second object of the dependency.

removeObject

public void removeObject(java.lang.Object object)
Removes all occurences of the given object in the dependencies.

Parameters:
object - The object that must be removed.

getDepends

public java.util.Vector<java.lang.Object> getDepends(java.lang.Object object)
Gets objects linked to the given object. This is a COPY of the internal list, therefore this list may be freely manipulated by the application.

Parameters:
object - The object whose dependencies must be retrieved.
Returns:
List of objects linked to the given object, null if object is null or if it has no dependendy.

keys

public java.util.Enumeration<java.lang.Object> keys()
Gets the keys list of dependencies defined in this object.

Returns:
The enumeration of all the objects that are contained in these dependencies.

getSize

public int getSize()
Gets the number of dependencies between objects contained in this instance of LyDependencies.

Returns:
the number of dependencies in this list

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com