JBoss Managed Parent POM 2.1.1.SP2

org.jboss.metatype.api.values
Interface TableValue

All Superinterfaces:
Cloneable, MetaValue, Serializable
All Known Implementing Classes:
TableValueSupport

public interface TableValue
extends MetaValue

TableValue.

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Method Summary
 MetaValue[] calculateIndex(CompositeValue value)
          Calculate the index for the value passed if it were added to the table value.
 void clear()
          Removes all CompositeValues from the Table value
 boolean containsKey(MetaValue[] key)
          Determine whether the table value contains the passed value as a row.
 boolean containsValue(CompositeValue value)
          Determine whether the table value contains the passed value.
 CompositeValue get(MetaValue[] key)
          Retrieve the composite value for the passed index.
 TableMetaType getMetaType()
          Get the metatype for this value
 boolean isEmpty()
          Determine whether the table value is empty.
 Set<List<MetaValue>> keySet()
          Returns a set view of the index values.
 void put(CompositeValue value)
          Add a value to the table value.
 void putAll(CompositeValue[] values)
          Add all the passed values.
 CompositeValue remove(MetaValue[] key)
          Removes the value for the passed and returns the removed value, or null if the key was not present.
 int size()
          Retrieve the number of rows in the table value.
 Collection<CompositeValue> values()
          Returns a set view of the row values.
 
Methods inherited from interface org.jboss.metatype.api.values.MetaValue
clone
 

Method Detail

getMetaType

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

Specified by:
getMetaType in interface MetaValue
Returns:
the metatype

calculateIndex

MetaValue[] calculateIndex(CompositeValue value)
Calculate the index for the value passed if it were added to the table value. The validity of the passed value is checked. But the table value isn't checked to see whether the index is already used.

Parameters:
value - the value for which the index is calculated.
Returns:
the calculated index
Throws:
IllegalArgumentException - for a null value or when the passed value is not valid for the table value's row type.

size

int size()
Retrieve the number of rows in the table value.

Returns:
the number of rows.

isEmpty

boolean isEmpty()
Determine whether the table value is empty.

Returns:
true when there are no rows, false otherwise

containsKey

boolean containsKey(MetaValue[] key)
Determine whether the table value contains the passed value as a row. If the passed value is null or invalid, false is returned.

Parameters:
key - the value to check
Returns:
true when the value is a row index, false otherwise

containsValue

boolean containsValue(CompositeValue value)
Determine whether the table value contains the passed value. If the passed value is null or invalid, false is returned.

Parameters:
value - the value to check
Returns:
true when the value is a row index, false otherwise

get

CompositeValue get(MetaValue[] key)
Retrieve the composite value for the passed index.

Parameters:
key - the index to retrieve
Returns:
the composite value
Throws:
IllegalArgumentException - when the passed key is null or when the passed key does match the row type of the table value.

put

void put(CompositeValue value)
Add a value to the table value. The value must have the same CompositeMetaType has the table value and there is no value already occupying the index for the value.

Parameters:
value - the value to add
Throws:
IllegalArgumentException - when the passed value is null or when the value is not valid for the row type of the tabular data or when the index for the value is already occupied.

remove

CompositeValue remove(MetaValue[] key)
Removes the value for the passed and returns the removed value, or null if the key was not present.

Parameters:
key - the index of the value to remove
Returns:
the removed value
Throws:
IllegalArgumentException - when the passed key is null or when the key is not valid for the table value

putAll

void putAll(CompositeValue[] values)
Add all the passed values. All the values are checked before addition including any duplicates that might be added. Either all or no value is added.

Parameters:
values - the values to add
Throws:
IllegalArgumentException - when the passed values is null or an element of the values is null or when one of value is not valid for the row type of the table value or when the index for one of the values is already occupied.

clear

void clear()
Removes all CompositeValues from the Table value


keySet

Set<List<MetaValue>> keySet()
Returns a set view of the index values.

Returns:
the set of index values.

values

Collection<CompositeValue> values()
Returns a set view of the row values.

Returns:
the set of row values.

JBoss Managed Parent POM 2.1.1.SP2

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