org.jboss.metatype.api.values
Class CollectionValueSupport

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

public class CollectionValueSupport
extends AbstractMetaValue
implements CollectionValue

CollectionValueSupport.

Author:
Ales Justin
See Also:
Serialized Form

Constructor Summary
CollectionValueSupport(CollectionMetaType metaType)
          Create a new CollectionValueSupport.
CollectionValueSupport(CollectionMetaType metaType, MetaValue[] elements)
          Create a new ArrayValueSupport.
 
Method Summary
 MetaValue clone()
          Clone the meta value
 boolean equals(Object obj)
           
 MetaValue[] getElements()
          Get the value.
 CollectionMetaType getMetaType()
          Get the metatype for this value
 int getSize()
          Get the size of the collection.
 int hashCode()
           
 Iterator<MetaValue> iterator()
           
 void setElements(MetaValue[] elements)
          Set the value.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectionValueSupport

public CollectionValueSupport(CollectionMetaType metaType)
Create a new CollectionValueSupport.

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

CollectionValueSupport

public CollectionValueSupport(CollectionMetaType metaType,
                              MetaValue[] elements)
Create a new ArrayValueSupport.

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

getMetaType

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

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

getElements

public MetaValue[] getElements()
Get the value.

Specified by:
getElements in interface CollectionValue
Returns:
the value.

getSize

public int getSize()
Get the size of the collection.

Specified by:
getSize in interface CollectionValue
Returns:
size of the collection.

iterator

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

setElements

public void setElements(MetaValue[] elements)
Set the value.

Parameters:
elements - the elements.

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


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