예제 #1
0
 public void Dispose()
 //throws com.WDataSci.WDS.WDSException, Exception
 {
     if (this.FileMatter != null)
     {
         this.FileMatter.Dispose();
     }
     this.FileMatter = null;
     if (this.SchemaMatter != null)
     {
         this.SchemaMatter.Dispose();
     }
     this.SchemaMatter = null;
     //this.ModeMatter.Dispose();
     this.ModeMatter = null;
     if (this.HDF5Matter != null)
     {
         this.HDF5Matter.Dispose();
     }
     this.HDF5Matter = null;
     if (this.DBBMatter != null)
     {
         this.DBBMatter.Dispose();
     }
     this.DBBMatter = null;
     /* C# >>> */
     GC.Collect();
     GC.WaitForPendingFinalizers();
     GC.Collect();
     GC.WaitForPendingFinalizers();
     /* <<< C# */
 }
예제 #2
0
 public RecordSetMD cWithHeaderRow()
 {
     if (this.FileMatter == null)
     {
         this.FileMatter = new WranglerFlatFile();
     }
     this.FileMatter.hasHeaderRow = true;
     return(this);
 }
예제 #3
0
        public RecordSetMD cAs(RecordSetMDEnums.eType arg, RecordSetMDEnums.eSchemaType schema)
        //throws com.WDataSci.WDS.WDSException
        {
            this.Type       = arg;
            this.SchemaType = schema;
            if (this.SchemaType.bIn(RecordSetMDEnums.eSchemaType.XSD, RecordSetMDEnums.eSchemaType.XML))
            {
                this.SchemaMatter = new __SchemaMatter();
            }
            if (this.ModeMatter == null && this.Mode.Equals(RecordSetMDEnums.eMode.Internal))
            {
                this.ModeMatter = new __ModeMatter();
                this.ModeMatter.bRepeatInputFields = false;
            }
            switch (this.Type)
            {
            //case DBB:
            case RecordSetMDEnums.eType.DBB:
                this.DBBMatter = new WranglerDBB();
                break;

            //case HDF5:
            case RecordSetMDEnums.eType.HDF5:
                if (this.SchemaType.bIn(RecordSetMDEnums.eSchemaType.Unknown))
                {
                    this.SchemaType = RecordSetMDEnums.eSchemaType.HDF5;
                }
                this.FileMatter = new WranglerFlatFile();
                this.DBBMatter  = new WranglerDBB();
                this.HDF5Matter = new WranglerHDF5();
                break;

            //case TXT:
            case RecordSetMDEnums.eType.TXT:
                this.FileMatter     = new WranglerFlatFile();
                this.FileMatter.Dlm = "\t";
                break;

            //case Dlm:
            case RecordSetMDEnums.eType.Dlm:
            //case CSV:
            case RecordSetMDEnums.eType.CSV:
                this.FileMatter     = new WranglerFlatFile();
                this.FileMatter.Dlm = ",";
                break;

            //case XML:
            case RecordSetMDEnums.eType.XML:
            //case JSON:
            case RecordSetMDEnums.eType.JSON:
            //case SQL:
            case RecordSetMDEnums.eType.SQL:
            default:
                throw new WDSException("Error RecordSetMD Type, %s, not implemented yet!");
            }
            return(this);
        }
예제 #4
0
 public RecordSetMD cWithDlm(String arg)
 //throws com.WDataSci.WDS.WDSException
 {
     if (this.Type.bIn(RecordSetMDEnums.eType.HDF5, RecordSetMDEnums.eType.DBB, RecordSetMDEnums.eType.JSON, RecordSetMDEnums.eType.XML))
     {
         throw new WDSException("Error RecordSetMD must be a flat file type in order to set a delimiter!");
     }
     if (this.FileMatter == null)
     {
         this.FileMatter = new WranglerFlatFile();
     }
     this.FileMatter.Dlm = arg;
     return(this);
 }
예제 #5
0
        private RecordSetMD cFile(String aFileName)
        {
            if (this.FileMatter == null)
            {
                this.FileMatter = new WranglerFlatFile();
            }

            /* Java >>> *
             * java.nio.file.Path p = Paths.get(aFileName);
             * this.FileMatter.Path = p.getParent().toString();
             * this.FileMatter.FileName = p.getFileName().toString();
             * /* <<< Java */
            /* C# >>> */
            this.FileMatter.Path     = System.IO.Path.GetDirectoryName(aFileName);
            this.FileMatter.FileName = System.IO.Path.GetFileName(aFileName);
            /* <<< C# */
            return(this);
        }
예제 #6
0
 public Boolean Equals(WranglerFlatFile arg)
 {
     if (!MatchingNullityAndValueEquals(this.Path, arg.Path))
     {
         return(false);
     }
     if (!MatchingNullityAndValueEquals(this.FileName, arg.FileName))
     {
         return(false);
     }
     if (!MatchingNullityAndValueEquals(this.Dlm, arg.Dlm))
     {
         return(false);
     }
     if (this.hasHeaderRow != arg.hasHeaderRow)
     {
         return(false);
     }
     return(true);
 }