org.jboss.metatype.api.values
Class ArrayValueSupport

java.lang.Object
  extended by org.jboss.metatype.api.values.AbstractMetaValue
      extended by org.jboss.metatype.api.values.ArrayValueSupport
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Object>, ArrayValue, MetaValue

public class ArrayValueSupport
extends AbstractMetaValue
implements ArrayValue

ArrayValue. TODO tests

Version:
$Revision: 1.1 $
Author:
Adrian Brock
See Also:
Serialized Form

Constructor Summary
ArrayValueSupport(ArrayMetaType metaType)
          Create a new ArrayValueSupport.
ArrayValueSupport(ArrayMetaType metaType, Object value)
          Create a new ArrayValueSupport.
 
Method Summary
 MetaValue clone()
          Clone the meta value
protected  String deepToString()
           
 boolean equals(Object obj)
           
 int getLength()
          Get the length of the array.
 ArrayMetaType getMetaType()
          Get the metatype for this value
 Object getValue()
          Get the value.
 Object getValue(int index)
          Get the array element at index.
 int hashCode()
           
 Iterator<Object> iterator()
           
 void setValue(Object value)
          Set the value.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayValueSupport

public ArrayValueSupport(ArrayMetaType metaType)
Create a new ArrayValueSupport.

Parameters:
metaType - the array meta type
Throws:
IllegalArgumentException - for a null array MetaType

ArrayValueSupport

public ArrayValueSupport(ArrayMetaType metaType,
                         Object value)
Create a new ArrayValueSupport.

Parameters:
metaType - the array meta type
value - the value
Throws:
IllegalArgumentException - for a null array MetaType
Method Detail

getMetaType

public ArrayMetaType getMetaType()
Description copied from interface: MetaValue
Get the metatype for this value

Specified by:
getMetaType in interface ArrayValue
Specified by:
getMetaType in interface MetaValue
Returns:
the metatype

getValue

public Object getValue()
Get the value.

Specified by:
getValue in interface ArrayValue
Returns:
the value.
See Also:
ArrayValue.getValue(int)

getLength

public int getLength()
Get the length of the array.

Specified by:
getLength in interface ArrayValue
Returns:
length of the array.

getValue

public Object getValue(int index)
Description copied from interface: ArrayValue
Get the array element at index.

Specified by:
getValue in interface ArrayValue
Parameters:
index - - index into the array.
Returns:
element at index.

iterator

public Iterator<Object> iterator()
Specified by:
iterator in interface Iterable<Object>

setValue

public void setValue(Object value)
Set the value.

Parameters:
value - the value.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

clone

public MetaValue clone()
Description copied from interface: MetaValue
Clone the meta value

Specified by:
clone in interface MetaValue
Overrides:
clone in class AbstractMetaValue
Returns:
the cloned meta value

deepToString

protected String deepToString()
Returns:
the deep string


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.