请帮助将Java代码转换为C# [英] please help covert the Java code to C#
问题描述
大家好,
我有一段java代码,需要转换为C#。
它是关于Iterable接口的,但我与此并不相似。
总计项目代码在
https://github.com/x2adrew/CS356_CalFuzzer/blob/47098cee77ca4add6b7a8fd94735ac667c24e335/ src / benchmarks / detinfer / pj / edu / rit / compbio / phyl / .svn / text-base / DnaSequenceList.java.svn-base [ ^ ]
Iterable defination的块如下:(谢谢!)
/ **
*返回此列表中DNA序列的迭代器。
*
* @return Iterator。
* /
公共迭代器< dnasequence> iterator()
{
返回新的迭代器< dnasequence>()
{
int i = 0;
public boolean hasNext()
{
return i< mySequence.length;
}
公共DnaSequence next()
{
返回mySequence [i ++]; < br $>
}
public void remove()
{
抛出新的UnsupportedOperationException();
}
};
}
Hello all,
I have got a peciece of java code, and need to covert to C#.
it's about Iterable interface, but i am not fimilar with that.
the totall project code is in the
https://github.com/x2adrew/CS356_CalFuzzer/blob/47098cee77ca4add6b7a8fd94735ac667c24e335/src/benchmarks/detinfer/pj/edu/rit/compbio/phyl/.svn/text-base/DnaSequenceList.java.svn-base[^]
the block of Iterable defination is as following:(Thanks!)
/**
* Returns an iterator for the DNA sequences in this list.
*
* @return Iterator.
*/
public Iterator<dnasequence> iterator()
{
return new Iterator<dnasequence>()
{
int i = 0;
public boolean hasNext()
{
return i < mySequence.length;
}
public DnaSequence next()
{
return mySequence[i++];
}
public void remove()
{
throw new UnsupportedOperationException();
}
};
}
推荐答案
您可能想要学习这个主题: https://msdn.microsoft.com/en-us/library/dscyy5s0.aspx [ ^ ]。
-SA
You may want to study this topic: https://msdn.microsoft.com/en-us/library/dscyy5s0.aspx[^].
—SA
有一些在线工具可以为您进行转换。试试吧。
这是一个这样的链接 - https://www.varycode.com [ ^ ]。免费版本有限,但你可以尝试一下。
There are some online tools that will do the conversion for you. Try them.
Here is one such link - https://www.varycode.com[^]. Free version is limited but you can try it out.
这篇关于请帮助将Java代码转换为C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!