LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.peer.union
Class LyUnionClass

java.lang.Object
  extended by leon.peer.union.LyUnionClass
All Implemented Interfaces:
LyClass

public class LyUnionClass
extends java.lang.Object
implements LyClass

This class is a simple peer class implementation that uses LyUnionObject as wrapper for instances.

See Also:
LyUnionObject

Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LyUnionClass(LyUnionBinding unionBinding, LyClassInfo classInfo)
          Constructs a table class.
 
Method Summary
 void addIdField(LyField field)
          Registers a peer field as an id field on this class.
 void clearTemporaryObjects()
          Clears the content of the vector of temporary object used by this class.
 LyValueSet copy(java.lang.Object target, java.lang.Object pattern)
          Copies all field values of an instance of this class on another instance.
 LyClass getClass1()
          Accessor to the first class of the union
 LyClass getClass2()
          Accessor to the second class of the union
 LyDataSource getDataSource()
          Gets the data source that manages all instances of this class.
 LyField getField(java.lang.String id)
          Retrieves a field on this class by its identifier.
 java.util.Vector<LyField> getFields()
          Gets the list of fields of this class.
 java.lang.String getId()
          Gets identifier of the class.
 java.util.Vector<LyField> getIdFields()
          Gets the list of fields that identifies instances of this class.
 java.lang.String getName()
          Gets name of the class.
 java.lang.Class<?> getObjectClass()
          Gets the physical representation of the instances : java class that really holds instances of this class.
 LyObjectId getObjectId(java.lang.Object object)
          Gets identifier for an instance of this class.
 LyUnionBinding getUnionBinding()
          Gets the associated union binding
 java.lang.Object getValue(java.lang.Object object, LyField field)
          Gets the value corresponding to the given field for an instance of this class.
 LyValueSet getValues(java.lang.Object object)
          Gets all field values from an instance of this class.
 java.lang.Object newInstance()
          Creates a new instance of this class.
 void rehash(java.lang.Object object)
          Recompute the object id of the specified object.
 void setDataSource(LyDataSource dataSource)
          Sets the data source of this class.
 void setValue(java.lang.Object object, LyField field, java.lang.Object value)
          Sets the value corresponding to the given field on an instance of this class.
 LyFilter[] splitFilter(LyFilter filter)
          This utility method split a filter on the current union class to an array of sub-filters, each corresponding to a sub-class of the union class.
 LySort[] splitSort(LySort sort)
          This utility method split a sort on the current union class to an array of sub-sorts, each corresponding to a sub-class of the union class.
 java.lang.String toString()
          Returns a display string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

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

LyUnionClass

public LyUnionClass(LyUnionBinding unionBinding,
                    LyClassInfo classInfo)
Constructs a table class.

Method Detail

clearTemporaryObjects

public void clearTemporaryObjects()
Clears the content of the vector of temporary object used by this class.


getId

public java.lang.String getId()
Gets identifier of the class.

Specified by:
getId in interface LyClass
Returns:
Identifier of the class.

getName

public java.lang.String getName()
Gets name of the class. The name of the class is the name in the information system. By default, if no name is specified, this method returns the id.

Specified by:
getName in interface LyClass
Returns:
Name of the class.

getObjectClass

public java.lang.Class<?> getObjectClass()
Gets the physical representation of the instances : java class that really holds instances of this class.

Specified by:
getObjectClass in interface LyClass
Returns:
Java class of the "objects" of this class.

getUnionBinding

public LyUnionBinding getUnionBinding()
Gets the associated union binding

Returns:
the associated union binding

setDataSource

public void setDataSource(LyDataSource dataSource)
Sets the data source of this class.

Parameters:
dataSource - Data source of the class.
Throws:
java.lang.IllegalStateException - If the class has already a data source.

getDataSource

public LyDataSource getDataSource()
Gets the data source that manages all instances of this class.

Specified by:
getDataSource in interface LyClass
Returns:
Data source that manages the instances of this class.

getIdFields

public java.util.Vector<LyField> getIdFields()
Gets the list of fields that identifies instances of this class.

Specified by:
getIdFields in interface LyClass
Returns:
List of fields from which an identifier can be calculated.

addIdField

public void addIdField(LyField field)
Registers a peer field as an id field on this class.

Parameters:
field - Peer field to register as id field.

getFields

public java.util.Vector<LyField> getFields()
Gets the list of fields of this class.

Specified by:
getFields in interface LyClass
Returns:
List of all fields of this class.

getField

public LyField getField(java.lang.String id)
Retrieves a field on this class by its identifier.

Specified by:
getField in interface LyClass
Parameters:
id - Identifier of the searched field.
Returns:
The field of this class which has the specified identifier, null if no field is found.

getObjectId

public LyObjectId getObjectId(java.lang.Object object)
Gets identifier for an instance of this class.

Specified by:
getObjectId in interface LyClass
Parameters:
object - Instance of this class.
Returns:
Identifier of the given object.

getValue

public java.lang.Object getValue(java.lang.Object object,
                                 LyField field)
Gets the value corresponding to the given field for an instance of this class.

Specified by:
getValue in interface LyClass
Parameters:
object - Instance of this class.
field - Field for which a value is requested.
Returns:
Value of the given field on the specified instance.

setValue

public void setValue(java.lang.Object object,
                     LyField field,
                     java.lang.Object value)
Sets the value corresponding to the given field on an instance of this class.

Specified by:
setValue in interface LyClass
Parameters:
object - Instance of this class on which a value is set.
field - Field for which a value is set.
value - Value set for the given field on the specified instance.

copy

public LyValueSet copy(java.lang.Object target,
                       java.lang.Object pattern)
Copies all field values of an instance of this class on another instance.

Specified by:
copy in interface LyClass
Parameters:
target - Object on which values are copied.
pattern - Object from which values are get.
Returns:
Field values that are copied from object2 to object1.

getValues

public LyValueSet getValues(java.lang.Object object)
Gets all field values from an instance of this class.

Specified by:
getValues in interface LyClass
Parameters:
object - Instance of this class.
Returns:
All the field values of the given instance.

newInstance

public java.lang.Object newInstance()
                             throws java.lang.InstantiationException,
                                    java.lang.IllegalAccessException
Creates a new instance of this class.

Specified by:
newInstance in interface LyClass
Returns:
New instance of this class.
Throws:
java.lang.IllegalAccessException - If the class or initializer is not accessible.
java.lang.InstantiationException - If an application tries to instantiate an abstract class or an interface, or if the instantiation fails for some other reason.

splitSort

public LySort[] splitSort(LySort sort)
This utility method split a sort on the current union class to an array of sub-sorts, each corresponding to a sub-class of the union class.

Parameters:
sort - a sort defined on the current union class.
Returns:
an array of sorts, each defined on a sub-class of the current union class.

splitFilter

public LyFilter[] splitFilter(LyFilter filter)
This utility method split a filter on the current union class to an array of sub-filters, each corresponding to a sub-class of the union class.

Parameters:
filter - a filter defined on the current union class.
Returns:
an array of filters, each defined on a sub-class of the current union class.

toString

public java.lang.String toString()
Returns a display string.

Overrides:
toString in class java.lang.Object

rehash

public void rehash(java.lang.Object object)
Recompute the object id of the specified object.

Specified by:
rehash in interface LyClass
Parameters:
object - object to rehash

getClass1

public LyClass getClass1()
Accessor to the first class of the union

Returns:
First peer class of the union

getClass2

public LyClass getClass2()
Accessor to the second class of the union

Returns:
Second peer class of the union

(c) January 2013 - W4 S.A.

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