com.sap.mdm.valuetypes
Class MultiValue

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

public class MultiValue
extends AbstractMdmValue

This class represents MDM multi-value.


Nested Class Summary
 
Nested classes inherited from class com.sap.mdm.valuetypes.MdmValue
MdmValue.Type
 
Constructor Summary
MultiValue()
          Empty constructor
MultiValue(MdmValue[] values)
          Constructor
MultiValue(MultiValue value)
          Constructs with the specified parameter.
 
Method Summary
 int addValue(int index, MdmValue value)
          Add single MdmValue to the list of values at the specified position
 int addValue(MdmValue value)
          Add single MdmValue to the end of values list
 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)
           
 int getType()
          Get type of MdmValue instance.
 MdmValue getValue(int index)
          Get value at the specified position
 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 isMultivalue()
          Specify if MdmValue is multi-value instance
 boolean isNull()
          Specify if MdmValue is NULL
 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 setValues(MdmValue[] values)
          Set array of values.
 void sortLinks()
          For internal use only Sorts values by display values
 String 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

MultiValue

public MultiValue()
Empty constructor


MultiValue

public MultiValue(MdmValue[] values)
Constructor

Parameters:
values -

MultiValue

public MultiValue(MultiValue value)
Constructs with the specified parameter.

Parameters:
value - the other value
Method Detail

isNull

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

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

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
Specified by:
getType in class AbstractMdmValue

isMultivalue

public boolean isMultivalue()
Description copied from interface: MdmValue
Specify if MdmValue is multi-value instance

Specified by:
isMultivalue in interface MdmValue
Overrides:
isMultivalue in class AbstractMdmValue

getValuesCount

public int getValuesCount()
Get count of values in the multi-value list

Returns:
count of values

getValues

public MdmValue[] getValues()
Get array of values that are stored in this class

Returns:
array of values

getValue

public MdmValue getValue(int index)
                  throws IllegalArgumentException
Get value at the specified position

Parameters:
index - position of value in the multi-value list
Returns:
MdmValue at the specified position
Throws:
IllegalArgumentException - if the index is out of range

setValues

public void setValues(MdmValue[] values)
               throws IllegalArgumentException
Set array of values. This method replace all values stored in this class

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

containsValue

public boolean containsValue(MdmValue value)
Check if this instance contains the specified value

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

addValue

public int addValue(int index,
                    MdmValue value)
             throws IllegalArgumentException
Add single MdmValue to the list of values at the specified position

Parameters:
index - position the value should be added to. If index=-1 then value is added to the end of list
value - value to add
Returns:
position of new added value in the list of values
Throws:
IllegalArgumentException - if the specified value already exist in the list of values

addValue

public int addValue(MdmValue value)
             throws IllegalArgumentException
Add single MdmValue to the end of values list

Parameters:
value - value to add
Returns:
position of new added value in the list of values
Throws:
IllegalArgumentException - if the specified value already exist in the list of values

removeValue

public void removeValue(MdmValue value)
Remove specified value from the list of values

Parameters:
value - value that should be removed

removeValue

public MdmValue removeValue(int index)
                     throws IllegalArgumentException
Remove value at the specified position in the list of values

Parameters:
index - position of removed value
Returns:
instance of removed value
Throws:
IllegalArgumentException - if index is out of bounds

clearValues

public void clearValues()
Remove all values from the list.


clone

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

Specified by:
clone in interface MdmValue
Specified by:
clone in class AbstractMdmValue

equals

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

hashCode

public int hashCode()
See Also:
Object.hashCode()

toString

public String toString()
See Also:
Object.toString()

compareTo

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

Specified by:
compareTo in class AbstractMdmValue
Parameters:
otherValue - the MdmValue to be compared.
Returns:
the value 0 if the argument is a MdmValue is equal to this MdmValue; the value is less than 0 if this MdmValue is less than the argument MdmValue; the value is greater than 0 if this MdmValue is greater than the argument MdmValue;

sortLinks

public void sortLinks()
For internal use only Sorts values by display values



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.