Main Page   Class Hierarchy   Compound List   File List   Compound Members  

EDLChunk.java

00001 /*
00002  *  Copyright 2006 Columbia University.
00003  *
00004  *  This file is part of MEAPsoft.
00005  *
00006  *  MEAPsoft is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License version 2 as
00008  *  published by the Free Software Foundation.
00009  *
00010  *  MEAPsoft is distributed in the hope that it will be useful, but
00011  *  WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *  General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with MEAPsoft; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00018  *  02110-1301 USA
00019  *
00020  *  See the file "COPYING" for the text of the license.
00021  */
00022 
00023 package com.meapsoft;
00024 
00025 import java.util.Iterator;
00026 import java.util.Vector;
00027 
00040 public class EDLChunk extends FeatChunk
00041 {
00042     public double dstTime;
00043     public Vector commands; 
00044 
00048     public EDLChunk(String sf, double st, double l, double dt)
00049     {
00050         super(sf,st,l);
00051         dstTime = dt;
00052 
00053         commands = new Vector();
00054     }
00055    
00056     public EDLChunk(Chunk c, double dt)
00057     {
00058         this(c.srcFile, c.startTime, c.length, dt);
00059     }
00060 
00061     public EDLChunk(FeatChunk c, double dt)
00062     {
00063         this(c.srcFile, c.startTime, c.length, dt);
00064         features = c.features;
00065     }
00066 
00071     public int compareTo(Object o) throws ClassCastException
00072     {
00073         try
00074         {
00075             EDLChunk c = (EDLChunk)o;
00076             return Double.compare(dstTime, c.dstTime);
00077         }
00078         catch(ClassCastException e)
00079         {
00080             return super.compareTo(o);
00081         }
00082     }
00083 
00088     public String toString()
00089     {
00090         StringBuffer s = new StringBuffer(200);
00091         s.append(dstTime).append(" ").append(srcFile).append(" ");
00092         s.append(startTime).append(" ").append(length).append(" ");
00093 
00094         if(commands != null)
00095         {
00096             Iterator x = commands.iterator();
00097             while(x.hasNext())
00098                 s.append(x.next()).append(" ");
00099         }
00100 
00101         s.append(comment).append("\n");
00102         
00103         return s.toString();
00104     }
00105 }
00106 

Generated on Thu May 11 15:04:10 2006 for MEAPsoft by doxygen1.2.18