LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data
Class LyRelationValue

java.lang.Object
  extended by leon.data.LyValue
      extended by leon.data.LyFieldInfoValue
          extended by leon.data.LyRelationValue

public final class LyRelationValue
extends LyFieldInfoValue

This class offers methods for constructing, accessing and modifying values corresponding to a LyRelationFieldInfo.

See Also:
LyRelationFieldInfo, LyObject

Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyRelationValue(LyRelationFieldInfo relationFieldInfo)
          Constructs an empty relation value for the given relation field.
LyRelationValue(LyRelationFieldInfo relationFieldInfo, LyObject value)
          Constructs a relation value for the given relation field from a LyObject.
LyRelationValue(LyRelationFieldInfo relationFieldInfo, LyObjectId value)
          Constructs a relation value for the given relation field from a LyObjectId.
LyRelationValue(LyRelationFieldInfo relationFieldInfo, LyObjectId[] value)
          Constructs a relation value for the given relation field from an array of LyObjectId.
LyRelationValue(LyRelationFieldInfo relationFieldInfo, LyObjectList value)
          Constructs a relation value for the given relation field from a LyObjectList.
LyRelationValue(LyRelationFieldInfo relationFieldInfo, java.lang.String value)
          Constructs a relation value for the given relation field from a string.
 
Method Summary
 LyObject getObject(int index)
          Gets value at the given index as a LyObject.
 LyObjectId getObjectId(int index)
          Gets value at the given index as a LyObjectId.
 LyObjectList getObjectList()
          Gets value of this relation value as a LyObjectList.
 java.lang.String getString(int index)
          Gets value at the given index as a String.
 short getValueCount()
          Gets number of selected objects in this relation value.
 
Methods inherited from class leon.data.LyFieldInfoValue
compare, contains, equals, equals, getFieldInfo, getName, getName, getShortName, getString
 
Methods inherited from class leon.data.LyValue
getField, getValue, isNull, setValue, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyRelationValue

public LyRelationValue(LyRelationFieldInfo relationFieldInfo)
Constructs an empty relation value for the given relation field.

Parameters:
relationFieldInfo - Relation fieldInfo for which a value is created.

LyRelationValue

public LyRelationValue(LyRelationFieldInfo relationFieldInfo,
                       java.lang.String value)
Constructs a relation value for the given relation field from a string.

Parameters:
relationFieldInfo - Relation fieldInfo for which a value is created.
value - String value (as expected by parse method).
See Also:
LyRelationFieldInfo.parse(java.lang.String)

LyRelationValue

public LyRelationValue(LyRelationFieldInfo relationFieldInfo,
                       LyObjectId value)
Constructs a relation value for the given relation field from a LyObjectId.

Parameters:
relationFieldInfo - Relation fieldInfo for which a value is created.
value - Value given as a LyObjectId.
Throws:
java.lang.IllegalArgumentException - If the given object id doesn't concern a class to which the relation field is related with.

LyRelationValue

public LyRelationValue(LyRelationFieldInfo relationFieldInfo,
                       LyObjectId[] value)
Constructs a relation value for the given relation field from an array of LyObjectId.

Parameters:
relationFieldInfo - Relation fieldInfo for which a value is created.
value - Value given as an array of LyObjectId.
Throws:
java.lang.IllegalArgumentException - If the relation field is not multiple and the array length is greater than 1.
java.lang.IllegalArgumentException - If one of the given object ids doesn't concern a class to which the relation field is related with.

LyRelationValue

public LyRelationValue(LyRelationFieldInfo relationFieldInfo,
                       LyObject value)
Constructs a relation value for the given relation field from a LyObject.

Parameters:
relationFieldInfo - Relation fieldInfo for which a value is created.
value - Value given as a LyObject.
Throws:
java.lang.IllegalArgumentException - If the given object doesn't belong to a class to which the relation field is related with.

LyRelationValue

public LyRelationValue(LyRelationFieldInfo relationFieldInfo,
                       LyObjectList value)
Constructs a relation value for the given relation field from a LyObjectList.

Parameters:
relationFieldInfo - Relation fieldInfo for which a value is created.
value - Value given as a LyObjectId.
Throws:
java.lang.IllegalArgumentException - If the relation field is not multiple and the list size is greater than 1.
java.lang.IllegalArgumentException - If one object of the given list doesn't belong to a class to which the relation field is related with.
Method Detail

getObjectId

public LyObjectId getObjectId(int index)
Gets value at the given index as a LyObjectId.

Parameters:
index - Index of requested object id.
Returns:
Value at the given index returned as LyObjectId.
Throws:
java.lang.IllegalArgumentException - If index is negative.
java.lang.IllegalArgumentException - If index is greater than the number of objects selected in this value.

getObject

public LyObject getObject(int index)
Gets value at the given index as a LyObject.

Parameters:
index - Index of requested object.
Returns:
Value at the given index returned as LyObject.
Throws:
java.lang.IllegalArgumentException - If index is negative.
java.lang.IllegalArgumentException - If index is greater than the number of objects selected in this value.

getString

public java.lang.String getString(int index)
Gets value at the given index as a String.

Parameters:
index - Index of requested string.
Returns:
Value at the given index returned as String.
Throws:
java.lang.IllegalArgumentException - If index is negative.
java.lang.IllegalArgumentException - If index is greater than the number of objects selected in this value.

getValueCount

public short getValueCount()
Gets number of selected objects in this relation value.

Returns:
Number of selected objects (0 if no object is selected in this value, can't be greater than 1 if the corresponding relation field is not multiple).

getObjectList

public LyObjectList getObjectList()
Gets value of this relation value as a LyObjectList.

Returns:
An objects list corresponding to this relation value, null if the number of values contained in this relation value is 0.

(c) January 2013 - W4 S.A.

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