package org.griphyn.vdl.mapping;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface DSHandle extends Serializable {

    // get the type of the dataset, need to replace return type
    // with a Type interface.
    public String getType();

    public void init(Map params);

    public DSHandle getRoot();
    
    public DSHandle getParent();

    public DSHandle getField(Path path) throws InvalidPathException;
    
    public Collection getFields(Path path) throws InvalidPathException, HandleOpenException;

    public Object getValue();

    public void setValue(Object value) throws InvalidPathException;

    //create a new logical component
    public DSHandle createDSHandle(String fieldName) throws NoSuchFieldException;

    //write to the data source
    public void commit();

    // special file oriented methods, not sure if these apply to 
    // all datasets

    //get the filename of a specific field	
    public String getFilename();

    // get all the leaf file names for a sub-component
    public List getFileSet();

    // close
    public void closeShallow();
    
    public void closeDeep();

	public Collection getFringePaths() throws HandleOpenException;

	public Map getArrayValue();

	public Path getPathFromRoot();

	public void set(DSHandle svar);
	
	public String getParam(String name);
	
	public boolean isArray();
	
	public boolean isClosed();

	public void addListener(DSHandleListener listener);
}

@@ -367,28 +367,24 @@
  getRoot();%0A
-    
 %0A    public 
@@ -475,20 +475,16 @@
 eption;%0A
-    
 %0A    pub
@@ -977,17 +977,16 @@
 ic field
-%09
 %0A    pub
@@ -1143,20 +1143,16 @@
 llow();%0A
-    
 %0A    pub
@@ -1170,25 +1170,28 @@
 oseDeep();%0A%0A
-%09
+    
 public Colle
@@ -1242,17 +1242,20 @@
 ption;%0A%0A
-%09
+    
 public M
@@ -1271,25 +1271,28 @@
 ayValue();%0A%0A
-%09
+    
 public Path 
@@ -1307,25 +1307,28 @@
 romRoot();%0A%0A
-%09
+    
 public void 
@@ -1347,19 +1347,21 @@
  svar);%0A
-%09%0A%09
+%0A    
 public S
@@ -1389,19 +1389,21 @@
  name);%0A
-%09%0A%09
+%0A    
 public b
@@ -1424,11 +1424,13 @@
 ();%0A
-%09%0A%09
+%0A    
 publ
@@ -1457,9 +1457,12 @@
 );%0A%0A
-%09
+    
 publ
@@ -1511,8 +1511,9 @@
 ner);%0A%7D%0A
+%0A

fix inconsistent whitespace in DSHandle