Hi Phani,

On Tuesday 09 January 2007 07:21, phanirao palivela wrote:
> Today I am having this problem in running this program please help me.
> The Program is as follows:

<snip>

> public class thcAtom {
>
> public static void main(String a[])
> {
>     TotalHCountAtom thca=new TotalHCountAtom(1);
>      Vector v = new Vector();

Unless you specifically need synchronization for threaded working on the 
vector, you can better use ArrayList. It's is faster.

>      v.addElement("0");
>
>      if (!v.isEmpty())
>     {
>     IAtomContainer ac = (IAtomContainer)v.get(0);

You added a String, not a IAtomContainer, so this is not going to work.

>     int natom = ac.getAtomCount();
>     IAtom[] atoms = ac.getAtoms();
>
>     for (int i = 0; i < natom; i++)
>     {
>         thca.matches(atoms[i]);
>         System.out.println("output is "+thca.toString());
>     }
>
>     }
>     else
>     {
>         System.out.println("Hello");
>     }
>     System.out.println("output is "+thca.toString());
> }
> }
>
>
> end:
>
> At this line  am getting ArrayoutofIndex Exception : 0 at the run time.

You need to be more specific. On what line are you getting the error?

Egon

-- 
[EMAIL PROTECTED]
Cologne University Bioinformatics Center (CUBIC)
Blog: http://chem-bla-ics.blogspot.com/
GPG: 1024D/D6336BA6

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to