All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface javax.infobus.ImmediateAccess

public interface ImmediateAccess
ImmediateAccess is the access interface wrapper for simple DataItems which are not collections of other DataItems, and offers methods to extract the contained data as either a String or an Object.

The getPresentationString method differs from getValueAsString by including locale-specific formatting in the returned string. For example, getPresentationString might return "$100.00" while getValueAsString would return "100" for a DataItem.

Version:
$Revision: 1.10 $ $Date: 24 Feb 1998 17:04:32 $

Method Index

 o getPresentationString(Locale)
Extracts the contained data in a String representation which includes appropriate formatting characters like "$" for the specified locale.
 o getValueAsObject()
Extracts the contained data as an Object.
 o getValueAsString()
Extracts the contained data in a String representation, not necessarily equivalent to getValueAsObject.toString().
 o setValue(Object)
This method sets a new value for the data in the ImmediateAccess.

Methods

 o getValueAsString
 public abstract String getValueAsString()
Extracts the contained data in a String representation, not necessarily equivalent to getValueAsObject.toString(). Does not typically include formatting characters (like "$"), which are included in getPresentationString().

Returns:
the embedded data as a single String representation
 o getValueAsObject
 public abstract Object getValueAsObject()
Extracts the contained data as an Object.

Returns:
the DataItem data
 o getPresentationString
 public abstract String getPresentationString(Locale locale)
Extracts the contained data in a String representation which includes appropriate formatting characters like "$" for the specified locale. Localization of symbols and format is the responsibility of the DataItem and its source.

This method may throw UnsupportedOperationException to indicate that it does not support the specified locale.

Parameters:
locale - the locale for which the returned String should be formatted. Null indicates the producer's default locale.
Returns:
the embedded data including specified formatting
 o setValue
 public abstract void setValue(Object newValue) throws InvalidDataException
This method sets a new value for the data in the ImmediateAccess. The DataItem whose setValue has been called must do a deep copy of newValue rather than adopt a reference to it (so that further changes to newValue by the caller are not reflected after setValue returns)

This method may throw UnsupportedOperationException to indicate that setValue is not supported (its data is immutable).

Parameters:
newValue - the new data to be copied
Throws: InvalidDataException
if the data item supports modifications but the data in newValue is invalid for this item
Throws: UnsupportedOperationException
if the data item does not support modifications

All Packages  Class Hierarchy  This Package  Previous  Next  Index