Methods Summary |
---|
public void | addSet(java.net.URL[] urls)
if ( setAlreadyExists( urls )){
return;
}
TorrentUtils.announceGroupsInsertLast( torrent.getTorrent(), urls );
updated();
|
public TorrentAnnounceURLListSet | create(java.net.URL[] urls)
return( new TorrentAnnounceURLListSetImpl( this, torrent.getTorrent().getAnnounceURLGroup().createAnnounceURLSet(urls)));
|
public TorrentAnnounceURLListSet[] | getSets()
TOTorrentAnnounceURLGroup group = torrent.getTorrent().getAnnounceURLGroup();
TOTorrentAnnounceURLSet[] sets = group.getAnnounceURLSets();
TorrentAnnounceURLListSet[] res = new TorrentAnnounceURLListSet[sets.length];
for (int i=0;i<res.length;i++){
res[i] = new TorrentAnnounceURLListSetImpl( this, sets[i]);
}
return( res );
|
public void | insertSetAtFront(java.net.URL[] urls)
if ( setAlreadyExists( urls )){
return;
}
TorrentUtils.announceGroupsInsertFirst( torrent.getTorrent(), urls );
updated();
|
protected boolean | setAlreadyExists(java.net.URL[] urls)
TOTorrentAnnounceURLGroup group = torrent.getTorrent().getAnnounceURLGroup();
TOTorrentAnnounceURLSet[] sets = group.getAnnounceURLSets();
for (int i=0;i<sets.length;i++){
URL[] u = sets[i].getAnnounceURLs();
if ( u.length != urls.length ){
continue;
}
boolean all_found = true;
for (int j=0;j<urls.length;j++){
URL u1 = urls[j];
boolean this_found = false;
for ( int k=0;k<u.length;k++){
URL u2 = u[k];
if ( u1.toString().equals( u2.toString())){
this_found = true;
break;
}
}
if ( !this_found ){
all_found = false;
break;
}
}
if ( all_found ){
return( true );
}
}
return( false );
|
public void | setSets(TorrentAnnounceURLListSet[] sets)
TOTorrentAnnounceURLGroup group = torrent.getTorrent().getAnnounceURLGroup();
TOTorrentAnnounceURLSet[] res = new TOTorrentAnnounceURLSet[sets.length];
for (int i=0;i<res.length;i++){
res[i] = ((TorrentAnnounceURLListSetImpl)sets[i]).getSet();
}
group.setAnnounceURLSets( res );
updated();
|
protected void | updated()
torrent.updated();
|