home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / prosrc.bin / NewValue.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  1.4 KB  |  55 lines

  1. /*
  2.  * @(#)NewValue.java
  3.  *
  4.  * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
  5.  *
  6.  */
  7. /**
  8.  * <p>This class is used to change the value in the DataItem
  9.  *
  10.  */
  11.  
  12. package symantec.itools.db.beans.binding;
  13. import symantec.itools.db.beans.binding.databus.*;
  14. public class NewValue implements ImmediateAccess
  15. {
  16.     private Object Value;
  17.    /**
  18.     * Constructor, creates a newValue object from an Object. This object contains a new array of
  19.     * objects.
  20.     * @param value. the value of the newValue Object
  21.     */
  22.     public NewValue(Object value)
  23.     {
  24.         try
  25.         {
  26.             Value=value;
  27.         }
  28.         catch(Exception e)
  29.         {
  30.             Value=value;
  31.         }
  32.     }
  33.    /**
  34.     * returns the value of the newValue as a String.
  35.     * @return String. value of the Object
  36.     */
  37.     public String getValueAsString()
  38.     {
  39.         return((String)Value.toString());
  40.     }
  41.     /**
  42.     * returns the value of the newValue as a Object.
  43.     * @return Object. value of the Object
  44.     */
  45.     public Object getValueAsObject(){
  46.         if(Value==null)return null;
  47.         return((Object)Value);
  48.     }
  49.     public String getPresentationString(){
  50.         return("String");
  51.     }
  52.     public synchronized void addDataItemChangedListener(DataItemChangedListener dcl){}
  53.     public synchronized void removeDataItemChangedListener(DataItemChangedListener dcl){}
  54.  
  55. }