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 / MutableCollectionAccess.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  2.8 KB  |  50 lines

  1. /*
  2.  * @(#MutableCollectionAccess.java
  3.  *
  4.  * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
  5.  *
  6.  */
  7.  
  8. package symantec.itools.db.beans.binding.databus;
  9. public interface MutableCollectionAccess extends CollectionAccess
  10. {
  11. public void addDataItem(DataItem item);
  12.  
  13.      //This method adds the indicated data item to this collection. The implementation must create a copy of
  14.     // the new value from the argument object before returning, rather than saving a reference to it, because
  15.     // the caller may change its value after the return. In obtaining the new value from the argument, the
  16.      //provider's implementation may need to make a deep (recursive) copy of the new value to get all values
  17.      //changed by the consumer.
  18.  
  19.      //The implementation defines where the item is added to the collection. Following the addition of a new
  20.      //item, if a DataCursor has been established on the collection, the new item may or may not be
  21.      //accessible through the cursor, again depending on the implementation.
  22.  
  23. public void insertBeforeCursor(DataCursor where, DataItem item);
  24.  
  25. public void insertAfterCursor(DataCursor where, DataItem item);
  26.  
  27.     // This method inserts a copy of the indicated data item into this collection at the position indicated by the
  28.     // cursor. The implementation must create a copy of the new value from the argument object before
  29.     // returning, rather than saving a reference to it, because the caller may change its value after the return. In
  30.     // obtaining the new value from the argument, the provider's implementation may need to make a deep
  31.     // (recursive) copy of the new value to get all values changed by the consumer.
  32.  
  33.      //Some implementations may choose not to support this method, for example an unordered collection
  34.     // where the cursor has no particular meaning. Such sources must throw the exception (TBD), and
  35.     // document that the addDataItem is the only way to add an item to the collection.
  36.  
  37. public void removeDataItem(DataItem item);
  38.  
  39.      //This method removes locates the referenced item and removes it from this collection. The reference
  40.     // must be to an item returned from the collection, not one constructed by the client with the same value.
  41.     // This method may throw an exception as appropriate to the various failures possible in the
  42.     // implementation, or to indicate that the method is not supported.
  43.  
  44. public void removeAtCursor(DataCursor cursor);
  45.  
  46.      //This method removes the item referenced by the cursor from this collection. The effect on the
  47.      //DataCursor, if any, is defined by the implementation. This method may throw an exception as
  48.      //appropriate to the various failures possible in the implementation, or to indicate that the method is not
  49.      //supported.
  50. }