Lyrics3v1Iteratorpublic class Lyrics3v1Iterator extends Object implements Iterator
Fields Summary |
---|
private Lyrics3v1 | tag | private int | lastIndex | private int | removeIndex |
Constructors Summary |
---|
public Lyrics3v1Iterator(Lyrics3v1 lyrics3v1Tag)Creates a new Lyrics3v1Iterator datatype.
tag = lyrics3v1Tag;
|
Methods Summary |
---|
public boolean | hasNext()
return !((tag.getLyric().indexOf('\n", lastIndex) < 0) && (lastIndex > tag.getLyric().length()));
| public java.lang.String | next()
int nextIndex = tag.getLyric().indexOf('\n", lastIndex);
removeIndex = lastIndex;
String line;
if (lastIndex >= 0)
{
if (nextIndex >= 0)
{
line = tag.getLyric().substring(lastIndex, nextIndex);
}
else
{
line = tag.getLyric().substring(lastIndex);
}
lastIndex = nextIndex;
}
else
{
throw new NoSuchElementException("Iteration has no more elements.");
}
return line;
| public void | remove()
String lyric = tag.getLyric().substring(0, removeIndex) + tag.getLyric().substring(lastIndex);
tag.setLyric(lyric);
|
|