com.sap.mdm.valuetypes
Class MultiTupleValue

java.lang.Object
  extended bycom.sap.mdm.valuetypes.AbstractMdmValue
      extended bycom.sap.mdm.valuetypes.MultiValue
          extended bycom.sap.mdm.valuetypes.MultiTupleValue
All Implemented Interfaces:
Cloneable, Comparable, MdmValue

public class MultiTupleValue
extends MultiValue

A data structure representing a multi-valued tuple.

Since:
7.1

Nested Class Summary
 
Nested classes inherited from class com.sap.mdm.valuetypes.MdmValue
MdmValue.Type
 
Constructor Summary
MultiTupleValue()
          Empty constructor.
 
Method Summary
 int addValue(int index, MdmValue value)
          If the tuple value contains a valid tuple record Id, it is assume the user wants to modify the tuple value.
 int addValue(MdmValue value)
          If the tuple value contains a valid tuple record Id, it is assume the user wants to modify the tuple value.
 void clearValues()
          Remove all values from the list.
 Object clone()
          Clone MdmValue object
 int compareTo(MdmValue otherValue)
          Compares two MdmValue.
 boolean containsValue(MdmValue value)
          Check if this instance contains the specified value
 boolean equals(Object obj)
           
 TupleValue[] getModifyTupleRecords()
          Returns the tuple values that are marked for modifying.
 TupleValue[] getNewTupleRecords()
          Returns the tuple values that are marked for adding.
 TupleValue[] getRemoveTupleRecords()
          Returns the tuple values that are marked for deletion.
 int getType()
          Get type of MdmValue instance.
 TupleValue[] getUntouchTupleRecords()
          Returns the tuple values that are untouched.
 MdmValue getValue(int index)
          Returns the tuple value at the specified index.
 MdmValue[] getValues()
          Get array of values that are stored in this class
 int getValuesCount()
          Get count of values in the multi-value list
 int hashCode()
           
 boolean isNull()
          Specify if MdmValue is NULL
 void modifyTupleValue(TupleValue value)
          Modifies a tuple value to a tuple instance.
 void newTupleValue(TupleValue tupleValue)
          Adds a tuple value to a tuple instance.
 void removeTupleValue(TupleRecordId tupleRecordId)
          Removes a tuple value from a tuple instance.
 void removeTupleValue(TupleValue value)
          Removes a tuple value from a tuple instance.
 MdmValue removeValue(int index)
          Remove value at the specified position in the list of values
 void removeValue(MdmValue value)
          Remove specified value from the list of values
 void setInitial()
          For internal use only.
 void setValues(MdmValue[] values)
          Sets the new tuple values.
 
Methods inherited from class com.sap.mdm.valuetypes.MultiValue
isMultivalue, sortLinks, toString
 
Methods inherited from class com.sap.mdm.valuetypes.AbstractMdmValue
compareTo, isMultiregion
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiTupleValue

public MultiTupleValue()
Empty constructor.

Method Detail

getType

public int getType()
Description copied from interface: MdmValue
Get type of MdmValue instance. For MdmMultiValue instance this type specify type of multi-value elements Constants for MdmValue types are specified in this interface

Specified by:
getType in interface MdmValue
Overrides:
getType in class MultiValue

addValue

public int addValue(MdmValue value)
             throws IllegalArgumentException
If the tuple value contains a valid tuple record Id, it is assume the user wants to modify the tuple value. If the tuple value Id is not valid, it is assume the user wants to add a new tuple value. The recommendation is to use methods newTupleValue(TupleValue) and modifyTupleValue(TupleValue) instead.

Overrides:
addValue in class MultiValue
Parameters:
value - a tuple value
Returns:
position of new added value in the list of values
Throws:
IllegalArgumentException - if the specified value already exist in the list of values
See Also:
newTupleValue(TupleValue), modifyTupleValue(TupleValue)

addValue

public int addValue(int index,
                    MdmValue value)
             throws IllegalArgumentException
If the tuple value contains a valid tuple record Id, it is assume the user wants to modify the tuple value. If the tuple record Id is not valid, it is assume the user wants to add a new tuple value. The recommendation is to use methods newTupleValue(TupleValue) and modifyTupleValue(TupleValue) instead.

Overrides:
addValue in class MultiValue
Parameters:
index - the index array
value - a tuple value
Returns:
position of new added value in the list of values
Throws:
IllegalArgumentException - if the specified value already exist in the list of values
See Also:
newTupleValue(TupleValue), modifyTupleValue(TupleValue)

removeValue

public MdmValue removeValue(int index)
                     throws IllegalArgumentException
Description copied from class: MultiValue
Remove value at the specified position in the list of values

Overrides:
removeValue in class MultiValue
Parameters:
index - position of removed value
Returns:
instance of removed value
Throws:
IllegalArgumentException - if index is out of bounds

removeValue

public void removeValue(MdmValue value)
Description copied from class: MultiValue
Remove specified value from the list of values

Overrides:
removeValue in class MultiValue
Parameters:
value - value that should be removed

setValues

public void setValues(MdmValue[] values)
               throws IllegalArgumentException
Sets the new tuple values. This method basically calls addValue(MdmValue) for the individual array elements.

Overrides:
setValues in class MultiValue
Parameters:
values - array of new values
Throws:
IllegalArgumentException - if one of the values is not instance of MdmValue or if array of input values includes instances of different MdmValue classes
See Also:
addValue(MdmValue)

getValues

public MdmValue[] getValues()
Description copied from class: MultiValue
Get array of values that are stored in this class

Overrides:
getValues in class MultiValue
Returns:
array of values

clone

public Object clone()
Description copied from interface: MdmValue
Clone MdmValue object

Specified by:
clone in interface MdmValue
Overrides:
clone in class MultiValue

equals

public boolean equals(Object obj)
Overrides:
equals in class MultiValue
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class MultiValue
See Also:
Object.hashCode()

isNull

public boolean isNull()
Description copied from interface: MdmValue
Specify if MdmValue is NULL

Specified by:
isNull in interface MdmValue
Overrides:
isNull in class MultiValue

getValue

public MdmValue getValue(int index)
                  throws IllegalArgumentException
Returns the tuple value at the specified index.

Overrides:
getValue in class MultiValue
Parameters:
index - an index
Returns:
a tuple value
Throws:
IllegalArgumentException - if the index is out of range
See Also:
MultiValue.getValue(int)

clearValues

public void clearValues()
Description copied from class: MultiValue
Remove all values from the list.

Overrides:
clearValues in class MultiValue

compareTo

public int compareTo(MdmValue otherValue)
Description copied from class: AbstractMdmValue
Compares two MdmValue.

Overrides:
compareTo in class MultiValue

containsValue

public boolean containsValue(MdmValue value)
Description copied from class: MultiValue
Check if this instance contains the specified value

Overrides:
containsValue in class MultiValue
Parameters:
value - value whose presence in this instance is to be tested.
Returns:
true if this instance contains specified value, false otherwise

getValuesCount

public int getValuesCount()
Description copied from class: MultiValue
Get count of values in the multi-value list

Overrides:
getValuesCount in class MultiValue
Returns:
count of values

newTupleValue

public void newTupleValue(TupleValue tupleValue)
Adds a tuple value to a tuple instance.

Parameters:
tupleValue - a tuple value

modifyTupleValue

public void modifyTupleValue(TupleValue value)
Modifies a tuple value to a tuple instance.

Parameters:
value - a tuple value

removeTupleValue

public void removeTupleValue(TupleValue value)
Removes a tuple value from a tuple instance.

Parameters:
value - a tuple value

removeTupleValue

public void removeTupleValue(TupleRecordId tupleRecordId)
Removes a tuple value from a tuple instance.

Parameters:
tupleRecordId - a tuple record Id

getNewTupleRecords

public TupleValue[] getNewTupleRecords()
Returns the tuple values that are marked for adding.

Returns:
the tuple values

getModifyTupleRecords

public TupleValue[] getModifyTupleRecords()
Returns the tuple values that are marked for modifying.

Returns:
the tuple values

getUntouchTupleRecords

public TupleValue[] getUntouchTupleRecords()
Returns the tuple values that are untouched.

Returns:
the tuple values

getRemoveTupleRecords

public TupleValue[] getRemoveTupleRecords()
Returns the tuple values that are marked for deletion.

Returns:
the tuple values

setInitial

public void setInitial()
For internal use only. It marks all tuple values as not changed.



Copyright 2004-2007 by SAP AG. All Rights Reserved.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.