*) set SVN properties

*) minor changes

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7567 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 14 years ago
parent 2af8e33773
commit 3b40b98256

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 27.8.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -7,9 +7,9 @@
//
// This file ist contributed by Martin Thelian
//
// $LastChangedDate: 2006-02-20 23:57:42 +0100 (Mo, 20 Feb 2006) $
// $LastChangedRevision: 1715 $
// $LastChangedBy: theli $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

@ -2,7 +2,11 @@
* FileLoader
* Copyright 2010 by Michael Peter Christen
* First released 25.5.2010 at http://yacy.net
*
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based search engine
//
// $LastChangedDate: 2010-03-07 00:41:51 +0100 (So, 07 Mrz 2010) $
// $LastChangedRevision: 6719 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 6539 $
// $LastChangedBy: low012 $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -87,6 +87,7 @@ public class WorkTables extends Tables {
this.bookmarks = new YMarkTables(this);
}
@Override
public void clear(final String tablename) throws IOException {
super.clear(tablename);
this.bookmarks.clearIndex(tablename);

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: $
// $LastChangedRevision: $
// $LastChangedBy: $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -3,7 +3,10 @@
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2005
// last major change: 22.03.2005
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

@ -4,6 +4,10 @@
* Copyright 2009 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 29.08.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -20,11 +20,11 @@ public enum ContentDomain {
}
public static ContentDomain contentdomParser(final String dom) {
if (dom.equals("text")) return TEXT;
else if (dom.equals("image")) return IMAGE;
else if (dom.equals("audio")) return AUDIO;
else if (dom.equals("video")) return VIDEO;
else if (dom.equals("app")) return APP;
if ("text".equals(dom)) return TEXT;
else if ("image".equals(dom)) return IMAGE;
else if ("audio".equals(dom)) return AUDIO;
else if ("video".equals(dom)) return VIDEO;
else if ("app".equals(dom)) return APP;
return TEXT;
}

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-05-28 01:51:34 +0200 (Do, 28 Mai 2009) $
// $LastChangedRevision: 5988 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -86,6 +86,7 @@ public class DocumentIndex extends Segment {
super(workerThreadGroup, "query-" + count);
}
@Override
public void run() {
DigestURI f;
URIMetadataRow resultRow;
@ -214,6 +215,7 @@ public class DocumentIndex extends Segment {
* close the index.
* This terminates all worker threads and then closes the segment.
*/
@Override
public void close() {
// send termination signal to worker threads
for (int i = 0; i < this.worker.length; i++) {

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 1986 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-05-28 01:51:34 +0200 (Do, 28 Mai 2009) $
// $LastChangedRevision: 5988 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-05-28 01:51:34 +0200 (Do, 28 Mai 2009) $
// $LastChangedRevision: 5988 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2008-03-14 01:16:04 +0100 (Fr, 14 Mrz 2008) $
// $LastChangedRevision: 4558 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: $
// $LastChangedRevision: $
// $LastChangedBy: $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -7,8 +7,9 @@
//
//This file ist contributed by Martin Thelian
//
//last change: $LastChangedDate: 2006-05-12 16:35:56 +0200 (Fr, 12 Mai 2006) $ by $LastChangedBy: theli $
//Revision: $LastChangedRevision: 2086 $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by

@ -5,9 +5,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-03-30 17:31:25 +0200 (Mo, 30. March 2009) $
// $LastChangedRevision: 5756 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -69,6 +69,7 @@ public class SignatureOutputStream extends FilterOutputStream {
* write byte
* @see FilterOutputStream.write(int b)
*/
@Override
public void write(int b) throws IOException {
try {
signature.update((byte)b);
@ -78,6 +79,7 @@ public class SignatureOutputStream extends FilterOutputStream {
out.write(b);
}
@Override
public void write(byte[] b, int off, int len) throws IOException {
try {
signature.update(b, off, len);

@ -3,7 +3,10 @@
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
// last major change: 11.08.2004
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -76,6 +79,7 @@ public class bitfield {
return bb;
}
@Override
public String toString() {
throw new UnsupportedOperationException("testing");
/*

@ -1,9 +1,12 @@
// crypt.java
// cryptbig.java
// -------------------------------------
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
// last major change: 13.05.2004
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

@ -3,7 +3,10 @@
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
// last major change: 17.05.2004
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

@ -3,7 +3,10 @@
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
// last major change: 17.05.2004
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -21,6 +24,7 @@
package de.anomic.tools;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
@ -53,7 +57,7 @@ public class disorderSet extends HashSet<String> implements Set<String> {
public static void main(final String[] args) {
final disorderSet ds = new disorderSet();
for (int i = 0; i < args.length; i++) ds.add(args[i]);
ds.addAll(Arrays.asList(args));
for (int i = 0; i < args.length * 3; i++) System.out.print(ds.any() + " ");
System.out.println();
}

@ -3,7 +3,10 @@
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
// last major change: 26.12.2004
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -24,6 +27,7 @@ package de.anomic.tools;
import java.io.File;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.TreeSet;
import net.yacy.kelondro.util.FileUtils;
@ -34,7 +38,7 @@ public class enumerateFiles implements Enumeration<File> {
// implements iterative search through recursively defined subdirectories
// and return all paths to the files
private final ArrayList<TreeSet<File>> hierarchy; // contains TreeSet elements, each TreeSet contains File Entries
private final List<TreeSet<File>> hierarchy; // contains TreeSet elements, each TreeSet contains File Entries
private final boolean incOrder; // if true, the smallest value is returned first
private File buffer; // the prefetch-buffer
private final boolean return_files;

@ -3,7 +3,10 @@
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
// last major change: 13.05.2004
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -51,10 +54,8 @@ public class gzip {
fin.close();
fout.close();
} catch (final FileNotFoundException e) {
//System.err.println("ERROR: file '" + inFile + "' not found");
logger.logWarning("ERROR: file '" + inFile + "' not found", e);
} catch (final IOException e) {
//System.err.println("ERROR: IO trouble ");
logger.logWarning("ERROR: IO trouble ",e);
}
}
@ -75,10 +76,8 @@ public class gzip {
fin.close();
fout.close();
} catch (final FileNotFoundException e) {
//System.err.println("ERROR: file '" + inFile + "' not found");
logger.logWarning("ERROR: file '" + inFile + "' not found", e);
} catch (final IOException e) {
//System.err.println("ERROR: IO trouble ");
logger.logWarning("ERROR: IO trouble ",e);
}
}
@ -93,7 +92,6 @@ public class gzip {
fout.close();
return baos.toByteArray();
} catch (final IOException e) {
//System.err.println("ERROR: IO trouble ");
logger.logWarning("ERROR: IO trouble ",e);
return null;
}

@ -3,7 +3,10 @@
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
// last major change: 29.09.2004
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

@ -3,7 +3,10 @@
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
// last major change: 28.09.2004
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: $
// $LastChangedRevision: $
// $LastChangedBy: $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -5,9 +5,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: $
// $LastChangedRevision: $
// $LastChangedBy: $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -5,9 +5,9 @@
// first published on http://yacy.net
// Frankfurt, Germany, 28.01.2009
//
// $LastChangedDate: 2009-01-23 16:32:27 +0100 (Fr, 23 Jan 2009) $
// $LastChangedRevision: 5514 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

@ -5,9 +5,9 @@
// first published on http://yacy.net
// Frankfurt, Germany, 28.01.2009
//
// $LastChangedDate: 2009-01-23 16:32:27 +0100 (Fr, 23 Jan 2009) $
// $LastChangedRevision: 5514 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

@ -5,9 +5,9 @@
// first published on http://yacy.net
// Frankfurt, Germany, 28.01.2009
//
// $LastChangedDate: 2009-01-23 16:32:27 +0100 (Fr, 23 Jan 2009) $
// $LastChangedRevision: 5514 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

@ -4,9 +4,9 @@
// first published 05.11.2008 on http://yacy.net
// Frankfurt, Germany, 2008
//
// $LastChangedDate: 2008-09-03 02:30:21 +0200 (Mi, 03 Sep 2008) $
// $LastChangedRevision: 5102 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

@ -2,9 +2,9 @@
// (C) 2009 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// first published 09.02.2009 on http://yacy.net
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 1986 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -5,9 +5,9 @@
// first published on http://yacy.net
// Frankfurt, Germany, 28.01.2009
//
// $LastChangedDate: 2009-01-23 16:32:27 +0100 (Fr, 23 Jan 2009) $
// $LastChangedRevision: 5514 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -110,7 +110,7 @@ public class VerticalWordPartitionScheme implements PartitionScheme {
return dhtDistance(word, urlHash, peer.hash.getBytes());
}
private final long dhtDistance(final byte[] from, final String urlHash, final byte[] to) {
private long dhtDistance(final byte[] from, final String urlHash, final byte[] to) {
// the dht distance is a positive value between 0 and 1
// if the distance is small, the word more probably belongs to the peer
assert to != null;

@ -3,9 +3,9 @@
* Copyright 2008 by Michael Peter Christen
* First released 12.02.2008 at http://yacy.net
*
* $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
* $LastChangedRevision: 1986 $
* $LastChangedBy: orbiter $
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 1986 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -5,9 +5,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 1986 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -56,9 +56,9 @@ public class WebStructureGraph {
public static int maxhosts = 20000; // maximum number of hosts in web structure map
private final Log log;
private final File structureFile;
TreeMap<String, String> structure_old; // <b64hash(6)>','<host> to <date-yyyymmdd(8)>{<target-b64hash(6)><target-count-hex(4)>}*
TreeMap<String, String> structure_new;
private final File structureFile;
private final TreeMap<String, String> structure_old; // <b64hash(6)>','<host> to <date-yyyymmdd(8)>{<target-b64hash(6)><target-count-hex(4)>}*
private final TreeMap<String, String> structure_new;
public WebStructureGraph(final Log log, final File structureFile) {
this.log = log;
@ -352,7 +352,7 @@ public class WebStructureGraph {
}
}
private static final void joinStructure(final TreeMap<String, String> into, final TreeMap<String, String> from) {
private static void joinStructure(final TreeMap<String, String> into, final TreeMap<String, String> from) {
for (final Map.Entry<String, String> e: from.entrySet()) {
if (into.containsKey(e.getKey())) {
final Map<String, Integer> s0 = refstr2map(into.get(e.getKey()));

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen
* First released 29.6.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -5,9 +5,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2007-07-03 22:55:47 +0000 (Di, 03 Jul 2007) $
// $LastChangedRevision: 3950 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -5,9 +5,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-02-19 17:24:46 +0100 (Do, 19. Feb 2009) $
// $LastChangedRevision: 5621 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -4,6 +4,10 @@
* Copyright 2010 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 20.09.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -49,8 +53,11 @@ public class YaCySearchClient {
private String host, query;
private int port, offset;
public YaCySearchClient(String host, int port, String query) {
this.host = host; this.port = port; this.offset = -10; this.query = query;
public YaCySearchClient(final String host, final int port, final String query) {
this.host = host;
this.port = port;
this.offset = -10;
this.query = query;
}
public SearchResult next() throws IOException {
@ -63,18 +70,24 @@ public class YaCySearchClient {
public SearchResult() throws IOException {
URL url;
Document doc;
String u =
"http://" + host + ":" + port + "/yacysearch.rss?verify=false" +
"&startRecord=" + offset + "&maximumRecords=10&resource=local" +
"&query=" + query.replaceAll(" ", "+");
String u = new StringBuilder().append("http://")
.append(host)
.append(":")
.append(port)
.append("/yacysearch.rss?verify=false&startRecord=")
.append(offset)
.append("&maximumRecords=10&resource=local&query=")
.append(query.replaceAll(" ", "+")).toString();
try { url = new URL(u); } catch (MalformedURLException e) { throw new IOException (e); }
try { doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(url.openStream()); }
catch (ParserConfigurationException e) { throw new IOException (e); }
catch (SAXException e) { throw new IOException (e); }
NodeList nodes = doc.getElementsByTagName("item");
final NodeList nodes = doc.getElementsByTagName("item");
for (int i = 0; i < nodes.getLength(); i++)
this.add(new RSSEntry((Element) nodes.item(i)));
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (RSSEntry entry: this) sb.append(entry.toString());
@ -95,8 +108,16 @@ public class YaCySearchClient {
return (child instanceof CharacterData) ?
((CharacterData) child).getData() : dflt;
}
@Override
public String toString() {
return "Title : " + title + "\nLink : " + link + "\nDescription: " + snippet + "\n";
return new StringBuilder().append("Title : ")
.append(title)
.append("\nLink : ")
.append(link)
.append("\nDescription: ")
.append(snippet)
.append("\n").toString();
}
}

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -47,6 +51,7 @@ public class ConnectFour {
public Coin nextRole() {
return (this == red) ? blue : red;
}
@Override
public String toString() {return this.c;}
public final static Coin[] allCoins = {red, blue};
}
@ -74,6 +79,7 @@ public class ConnectFour {
public int hashCode() {
return this.column;
}
@Override
public String toString() {
return super.getRole().toString() + ":" + Integer.toString(this.column);
}
@ -134,6 +140,7 @@ public class ConnectFour {
}
public boolean equals(Object o) {
if (!(o instanceof Board)) return false;
Board om = (Board) o;
Coin c0, c1;
for (int i = 0; i < b.length; i++) {
@ -237,8 +244,9 @@ public class ConnectFour {
return moves;
}
@Override
public String toString() {
StringBuffer s = new StringBuffer((width + 1) * height);
StringBuilder s = new StringBuilder((width + 1) * height);
Coin coin;
for (int row = height - 1; row >= 0; row--) {
s.append('\"');

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -45,7 +49,7 @@ public class Hanoi {
@Override
public boolean equals(Object other) {
return this.size == ((Coin) other).size;
return (other != null && other instanceof Coin && this.size == ((Coin) other).size);
}
@Override
@ -53,6 +57,7 @@ public class Hanoi {
return this.size;
}
@Override
public String toString() {
return Integer.toString(size);
}
@ -79,7 +84,10 @@ public class Hanoi {
@Override
public boolean equals(Object other) {
return this.from == ((Move) other).from && this.to == ((Move) other).to;
return (other != null
&& other instanceof Move
&& this.from == ((Move) other).from
&& this.to == ((Move) other).to);
}
@Override
@ -87,6 +95,7 @@ public class Hanoi {
return 3 * this.from + 7 * this.to;
}
@Override
public String toString() {
return from + " -> " + to;
}
@ -106,6 +115,7 @@ public class Hanoi {
this.moves = 0;
}
@Override
public String toString() {
StringBuilder s = new StringBuilder();
s.append(stacks[0].toString());
@ -128,6 +138,7 @@ public class Hanoi {
@Override
public boolean equals(Object other) {
if (other == null || !(other instanceof Board)) return false;
Board b = (Board) other;
for (int i = 0; i < 3; i++) {
if (this.stacks[i].size() != b.stacks[i].size()) return false;
@ -164,7 +175,7 @@ public class Hanoi {
}
public List<Move> explore() {
ArrayList<Move> moves = new ArrayList<Move>();
final List<Move> moves = new ArrayList<Move>();
for (int from = 0; from < 3; from++) {
toloop: for (int to = 0; to < 3; to++) {
if (from == to) continue toloop;
@ -185,11 +196,11 @@ public class Hanoi {
}
public boolean isTermination(Unirole role) {
return stacks[0].size() == 0 && stacks[2].size() == 0;
return stacks[0].isEmpty() && stacks[2].isEmpty();
}
public Unirole isTermination() {
return (stacks[0].size() == 0 && stacks[2].size() == 0) ? Unirole.unirole : null;
return (stacks[0].isEmpty() && stacks[2].isEmpty()) ? Unirole.unirole : null;
}
}

@ -26,9 +26,14 @@ public class SchwarzerPeter {
public Karte(Kartentyp kartentyp, Kartenzaehler kartenzaehler) {
this.kartentyp = kartentyp; this.kartenzaehler = kartenzaehler;
}
@Override
public boolean equals(Object obj) {
return this.kartentyp == ((Karte) obj).kartentyp && this.kartenzaehler == ((Karte) obj).kartenzaehler;
return obj != null
&& obj instanceof Karte
&& this.kartentyp == ((Karte) obj).kartentyp
&& this.kartenzaehler == ((Karte) obj).kartenzaehler;
}
@Override
public int hashCode() {
return this.kartentyp.hashCode() + 16 + this.kartenzaehler.hashCode();
}
@ -77,10 +82,14 @@ public class SchwarzerPeter {
return new Spieler(n, this.spieleranzahl);
}
@Override
public boolean equals(Object obj) {
return this.spielernummer == ((Spieler) obj).spielernummer;
return obj != null
&& obj instanceof Spieler
&& this.spielernummer == ((Spieler) obj).spielernummer;
}
@Override
public int hashCode() {
return this.spielernummer;
}

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -29,6 +33,7 @@ public class testorder implements Comparable<testorder> {
public testorder(int x) {
this.x = x;
}
@Override
public String toString() {
return Integer.toString(this.x);
}

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -48,6 +52,7 @@ public abstract class AbstractFinding<SpecificRole extends Role> implements Find
this.priority = 0;
}
@Override
public abstract Object clone();
/**
@ -86,6 +91,8 @@ public abstract class AbstractFinding<SpecificRole extends Role> implements Find
return compare(this, o);
}
@Override
public abstract boolean equals(Object other);
@Override
public abstract int hashCode();
}

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -29,6 +33,7 @@ public abstract class AbstractModel<SpecificRole extends Role, SpecificFinding e
this.currentRole = currentRole;
}
@Override
public abstract Object clone();
/**
@ -48,6 +53,8 @@ public abstract class AbstractModel<SpecificRole extends Role, SpecificFinding e
this.currentRole = (SpecificRole) this.currentRole.nextRole();
}
@Override
public abstract boolean equals(Object other);
@Override
public abstract int hashCode();
}

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -197,11 +201,13 @@ public class Agent<
return list;
}
@Override
public int hashCode() {
return this.model.hashCode();
}
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object om) {
if (!(om instanceof Agent)) return false;
Agent<SpecificRole, SpecificFinding, SpecificModel> a = (Agent<SpecificRole, SpecificFinding, SpecificModel>) om;

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -42,11 +46,13 @@ public class Asset<
return this.finding;
}
@Override
public int hashCode() {
return (this.finding == null) ? this.model.hashCode() : this.model.hashCode() + this.finding.hashCode();
}
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object other) {
if (!(other instanceof Asset)) return false;
Asset<SpecificRole, SpecificFinding, SpecificModel> a = (Asset<SpecificRole, SpecificFinding, SpecificModel>) other;

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -20,6 +24,7 @@
package net.yacy.ai.greedy;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.BlockingQueue;
@ -30,7 +35,7 @@ import java.util.concurrent.BlockingQueue;
*/
public class Attempts<SpecificRole extends Role> {
TreeMap<Long, BlockingQueue<Finding<SpecificRole>>> stack;
Map<Long, BlockingQueue<Finding<SpecificRole>>> stack;
public Attempts() {
this.stack = new TreeMap<Long, BlockingQueue<Finding<SpecificRole>>>();

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -53,11 +57,13 @@ public class Challenge<
return this.finding;
}
@Override
public int hashCode() {
return this.agent.hashCode() + this.finding.hashCode();
}
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object other) {
if (!(other instanceof Challenge)) return false;
Challenge<SpecificRole, SpecificFinding, SpecificModel> c = (Challenge<SpecificRole, SpecificFinding, SpecificModel>) other;

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -73,6 +77,7 @@ public class Engine<
public class SettingRunner extends Thread {
@Override
public void run() {
Agent<SpecificRole, SpecificFinding, SpecificModel> agent;
Challenge<SpecificRole, SpecificFinding, SpecificModel> challenge;
@ -115,6 +120,7 @@ public class Engine<
public class AssetRunner extends Thread {
@SuppressWarnings("unchecked")
@Override
public void run() {
Challenge<SpecificRole, SpecificFinding, SpecificModel> challenge;
Agent<SpecificRole, SpecificFinding, SpecificModel> agent, nextAgent;

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -65,12 +69,14 @@ public interface Finding<SpecificRole extends Role> extends Comparator<Finding<S
* @param other
* @return true if this finding is equal to the other finding
*/
@Override
public boolean equals(Object other);
/**
* the hash code computation, necessary to place findings into hashtables
* @return a hash code for this object
*/
@Override
public int hashCode();
}

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -77,6 +81,7 @@ public interface Model<SpecificRole extends Role, SpecificFinding extends Findin
* do not include a computation based on latest actions
* @return a hash code
*/
@Override
public int hashCode();
/**
@ -84,6 +89,7 @@ public interface Model<SpecificRole extends Role, SpecificFinding extends Findin
* @param om
* @return true if other model is equal to the current model.
*/
@Override
public boolean equals(Object om);
/**

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 03.12.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -41,12 +45,14 @@ public interface Role {
* @param obj
* @return true if the current role and the given role are equal
*/
@Override
public boolean equals(Object obj);
/**
* necessary hashCode method for usage of Role in hash tables
* @return a hash code of the role
*/
@Override
public int hashCode();
}

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen, Frankfurt a. M., Germany
* First published 06.01.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2011 by Michael Peter Christen
* First released 2.1.2011 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2011 by Michael Peter Christen
* First released 2.1.2011 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2011 by Michael Peter Christen
* First released 2.1.2011 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2011 by Michael Peter Christen
* First released 2.1.2011 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -2,7 +2,11 @@
* ASCIIComparator
* Copyright 2010 by Michael Peter Christen
* First released 25.2.2011 at http://yacy.net
*
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This file is part of YaCy Content Integration
*
* This library is free software; you can redistribute it and/or
@ -41,6 +45,7 @@ public class ASCIIComparator implements Comparator<String> {
this.insensitive = insensitive;
}
@Override
public Object clone() {
return this; // because we do not have any class variables that changes
}
@ -67,10 +72,12 @@ public class ASCIIComparator implements Comparator<String> {
return 0;
}
@Override
public boolean equals(Object obj) {
return (obj == this);
}
@Override
public int hashCode() {
return System.identityHashCode(this);
}

@ -2,7 +2,11 @@
* Channel
* Copyright 2010 by Michael Peter Christen
* First released 10.5.2010 at http://yacy.net
*
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This file is part of YaCy Content Integration
*
* This library is free software; you can redistribute it and/or

@ -2,7 +2,11 @@
* Channels
* Copyright 2010 by Michael Peter Christen
* First released 10.5.2010 at http://yacy.net
*
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This file is part of YaCy Content Integration
*
* This library is free software; you can redistribute it and/or

@ -2,7 +2,11 @@
* Hit
* Copyright 2010 by Michael Peter Christen
* First released 10.5.2010 at http://yacy.net
*
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This file is part of YaCy Content Integration
*
* This library is free software; you can redistribute it and/or

@ -284,7 +284,7 @@ public class JSONArray {
*/
private String join(String separator) throws JSONException {
int len = length();
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < len; i += 1) {
if (i > 0) {
@ -418,6 +418,7 @@ public class JSONArray {
* @return a printable, displayable, transmittable
* representation of the array.
*/
@Override
public String toString() {
try {
return '[' + join(",") + ']';
@ -442,7 +443,7 @@ public class JSONArray {
return "[]";
}
int i;
StringBuffer sb = new StringBuffer("[");
StringBuilder sb = new StringBuilder("[");
if (len == 1) {
sb.append(JSONObject.valueToString(this.myArrayList.get(0),
indentFactor, indent));

@ -26,6 +26,7 @@ public class JSONException extends Exception {
this.cause = t;
}
@Override
public Throwable getCause() {
return this.cause;
}

@ -99,6 +99,7 @@ public class JSONObject {
* so the clone method returns itself.
* @return NULL.
*/
@Override
protected final Object clone() {
return this;
}
@ -110,6 +111,7 @@ public class JSONObject {
* @return true if the object parameter is the JSONObject.NULL object
* or null.
*/
@Override
public boolean equals(Object object) {
return object == null || object == this;
}
@ -119,6 +121,7 @@ public class JSONObject {
* Get the "null" string value.
* @return The string "null".
*/
@Override
public String toString() {
return "null";
}
@ -1114,7 +1117,7 @@ public class JSONObject {
char c = 0;
int i;
int len = string.length();
StringBuffer sb = new StringBuffer(len + 4);
StringBuilder sb = new StringBuilder(len + 4);
String t;
sb.append('"');
@ -1152,7 +1155,7 @@ public class JSONObject {
if (c < ' ' || (c >= '\u0080' && c < '\u00a0') ||
(c >= '\u2000' && c < '\u2100')) {
t = "000" + Integer.toHexString(c);
sb.append("\\u" + t.substring(t.length() - 4));
sb.append("\\u").append(t.substring(t.length() - 4));
} else {
sb.append(c);
}
@ -1292,10 +1295,11 @@ public class JSONObject {
* with <code>{</code>&nbsp;<small>(left brace)</small> and ending
* with <code>}</code>&nbsp;<small>(right brace)</small>.
*/
@Override
public String toString() {
try {
Iterator<?> keys = keys();
StringBuffer sb = new StringBuffer("{");
StringBuilder sb = new StringBuilder("{");
while (keys.hasNext()) {
if (sb.length() > 1) {
@ -1351,7 +1355,7 @@ public class JSONObject {
return "{}";
}
Iterator<String> keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
StringBuilder sb = new StringBuilder("{");
int newindent = indent + indentFactor;
Object o;
if (n == 1) {

@ -241,7 +241,7 @@ public class JSONTokener {
*/
public String nextString(char quote) throws JSONException {
char c;
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (;;) {
c = next();
switch (c) {
@ -297,7 +297,7 @@ public class JSONTokener {
* @return A string.
*/
public String nextTo(char d) throws JSONException {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (;;) {
char c = next();
if (c == d || c == 0 || c == '\n' || c == '\r') {
@ -319,7 +319,7 @@ public class JSONTokener {
*/
public String nextTo(String delimiters) throws JSONException {
char c;
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (;;) {
c = next();
if (delimiters.indexOf(c) >= 0 || c == 0 ||
@ -367,7 +367,7 @@ public class JSONTokener {
* formatting character.
*/
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) {
sb.append(c);
c = next();
@ -431,6 +431,7 @@ public class JSONTokener {
*
* @return " at {index} [character {character} line {line}]"
*/
@Override
public String toString() {
return " at " + index + " [character " + this.character + " line " + this.line + "]";
}

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen
* First released 25.5.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -299,7 +303,7 @@ public class MultiProtocolURI implements Serializable, Comparable<MultiProtocolU
for(int i=0; i<domainParts.length; i++) {
final String part = domainParts[i];
if(!Punycode.isBasic(part)) {
buffer.append("xn--" + Punycode.encode(part));
buffer.append("xn--").append(Punycode.encode(part));
} else {
buffer.append(part);
}
@ -890,6 +894,7 @@ public class MultiProtocolURI implements Serializable, Comparable<MultiProtocolU
return u.toString();
}
@Override
public int hashCode() {
return this.toNormalform(true, true).hashCode();
}

@ -3,6 +3,10 @@
* Copyright 2007 by Michael Peter Christen
* First released 16.7.2007 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -21,6 +25,7 @@
package net.yacy.cora.document;
import java.text.ParseException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.HashSet;
@ -56,7 +61,7 @@ public class RSSMessage implements Hit, Comparable<RSSMessage>, Comparator<RSSMe
private Token(String keylist) {
String[] k = keylist.split(",");
this.keys = new HashSet<String>();
for (String s: k) this.keys.add(s);
this.keys.addAll(Arrays.asList(k));
}
public String valueFrom(Map<String, String> map, String dflt) {
@ -115,10 +120,12 @@ public class RSSMessage implements Hit, Comparable<RSSMessage>, Comparator<RSSMe
return Token.link.valueFrom(this.map, "");
}
@Override
public boolean equals(Object o) {
return (o instanceof RSSMessage) && ((RSSMessage) o).getLink().equals(this.getLink());
}
@Override
public int hashCode() {
return getLink().hashCode();
}
@ -204,6 +211,7 @@ public class RSSMessage implements Hit, Comparable<RSSMessage>, Comparator<RSSMe
return sb.toString();
}
@Override
public String toString() {
return this.map.toString();
}

@ -3,6 +3,10 @@
* Copyright 2011 by Michael Peter Christen
* First released 25.2.2011 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,9 +3,9 @@
* Copyright 2010 by Sebastian Gaebel
* First released 01.07.2010 at http://yacy.net
*
* $LastChangedDate: 2010-06-16 17:11:21 +0200 (Mi, 16 Jun 2010) $
* $LastChangedRevision: 6974 $
* $LastChangedBy: sixcooler $
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

@ -4,9 +4,9 @@
* Copyright 2010 by Michael Peter Christen for LGPL
* Dual-Licensing for LGPL granted by Daniel Raap 07.08.2010 by email
*
* $LastChangedDate: 2008-03-14 01:16:04 +0100 (Fr, 14 Mrz 2008) $
* $LastChangedRevision: 4558 $
* $LastChangedBy: orbiter $
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

@ -3,6 +3,10 @@
* Copyright 2007 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 23.7.2007 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
* First released 28.10.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -83,6 +87,7 @@ public class Scanner extends Thread {
public MultiProtocolURI url() throws MalformedURLException {
return new MultiProtocolURI(this.protocol.name() + "://" + getHostName() + "/");
}
@Override
public String toString() {
try {
return new MultiProtocolURI(this.protocol.name() + "://" + this.inetAddress.getHostAddress() + "/").toNormalform(true, false);
@ -90,9 +95,11 @@ public class Scanner extends Thread {
return "";
}
}
@Override
public int hashCode() {
return this.inetAddress.hashCode();
}
@Override
public boolean equals(Object o) {
return (o instanceof Service) && ((Service) o).protocol == this.protocol && ((Service) o).inetAddress.equals(this.inetAddress);
}
@ -141,7 +148,7 @@ public class Scanner extends Thread {
*/
public static boolean acceptURL(MultiProtocolURI url) {
// if the scan range is empty, then all urls are accepted
if (scancacheScanrange == null || scancacheScanrange.size() == 0) return true;
if (scancacheScanrange == null || scancacheScanrange.isEmpty()) return true;
//if (System.currentTimeMillis() > scancacheValidUntilTime) return true;
InetAddress a = Domains.dnsResolve(url.getHost()); // try to avoid that!
@ -186,6 +193,7 @@ public class Scanner extends Thread {
this(Domains.myIntranetIPs(), concurrentRunner, timeout);
}
@Override
public void run() {
Service uri;
try {
@ -226,6 +234,7 @@ public class Scanner extends Thread {
this.service = service;
this.starttime = System.currentTimeMillis();
}
@Override
public void run() {
try {
if (TimeoutRequest.ping(this.service.getInetAddress().getHostAddress(), this.service.getProtocol().port, timeout)) {
@ -240,7 +249,7 @@ public class Scanner extends Thread {
ftpClient.login("anonymous", "anomic@");
List<String> list = ftpClient.list("/", false);
ftpClient.CLOSE();
access = list == null || list.size() == 0 ? Access.empty : Access.granted;
access = list == null || list.isEmpty() ? Access.empty : Access.granted;
} catch (IOException e) {
access = Access.denied;
}
@ -265,9 +274,11 @@ public class Scanner extends Thread {
public long age() {
return System.currentTimeMillis() - this.starttime;
}
@Override
public boolean equals(Object o) {
return (o instanceof Runner) && this.service.equals(((Runner) o).service);
}
@Override
public int hashCode() {
return this.service.hashCode();
}

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 08.10.2007 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -6,7 +6,11 @@
* last major change: 06.05.2004
* added html generation for directories: 5.9.2006
* migrated to the cora package and re-licensed under lgpl: 23.08.2010
*
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This file is part of YaCy Content Integration
*
* This library is free software; you can redistribute it and/or
@ -1144,6 +1148,7 @@ public class FTPClient {
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
final StringBuilder info = new StringBuilder(100);
info.append(name);
@ -2531,6 +2536,7 @@ public class FTPClient {
ftpClient.login("anonymous", "anomic@");
final LinkedBlockingQueue<entryInfo> queue = new LinkedBlockingQueue<entryInfo>();
new Thread() {
@Override
public void run() {
try {
sitelist(ftpClient, "/", queue);
@ -2616,16 +2622,16 @@ public class FTPClient {
page.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n");
page.append("<html><head>\n");
page.append(" <title>" + title + "</title>\n");
page.append(" <title>").append(title).append("</title>\n");
page.append(" <meta name=\"generator\" content=\"YaCy directory listing\">\n");
if (metaRobotNoindex) {
page.append(" <meta name=\"robots\" content=\"noindex\">\n");
}
page.append(" <base href=\"" + base + "\">\n");
page.append(" <base href=\"").append(base).append("\">\n");
page.append("</head><body>\n");
page.append(" <h1>" + title + "</h1>\n");
page.append(" <h1>").append(title).append("</h1>\n");
if (servermessage != null && greeting != null) {
page.append(" <p><pre>Server \"" + servermessage + "\" responded:\n");
page.append(" <p><pre>Server \"").append(servermessage).append("\" responded:\n");
page.append(" \n");
page.append(greeting);
page.append("\n");
@ -2641,13 +2647,13 @@ public class FTPClient {
// with link
nameStart = line.indexOf(info.name);
page.append(line.substring(0, nameStart));
page.append("<a href=\"" + base + info.name + ((info.type == filetype.directory) ? "/" : "") + "\">" + info.name + "</a>");
page.append("<a href=\"").append(base).append(info.name).append((info.type == filetype.directory) ? "/" : "").append("\">").append(info.name).append("</a>");
nameEnd = nameStart + info.name.length();
if (line.length() > nameEnd) {
page.append(line.substring(nameEnd));
}
} else if (line.startsWith("http://") || line.startsWith("ftp://") || line.startsWith("smb://") || line.startsWith("file://")) {
page.append("<a href=\"" + line + "\">" + line + "</a>");
page.append("<a href=\"").append(line).append("\">").append(line).append("</a>");
} else {
// raw
page.append(line);
@ -2656,7 +2662,7 @@ public class FTPClient {
}
page.append(" </pre>\n");
page.append(" <hr>\n");
if (system != null) page.append(" <pre>System info: \"" + system + "\"</pre>\n");
if (system != null) page.append(" <pre>System info: \"").append(system).append("\"</pre>\n");
page.append("</body></html>\n");
return page;

@ -3,9 +3,9 @@
* Copyright 2010 by Sebastian Gaebel
* First released 01.07.2010 at http://yacy.net
*
* $LastChangedDate: 2010-06-16 17:11:21 +0200 (Mi, 16 Jun 2010) $
* $LastChangedRevision: 6922 $
* $LastChangedBy: sixcooler $
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

@ -3,9 +3,9 @@
* Copyright 2010 by Sebastian Gaebel
* First released 01.07.2010 at http://yacy.net
*
* $LastChangedDate: 2010-06-16 17:11:21 +0200 (Mi, 16 Jun 2010) $
* $LastChangedRevision: 7011 $
* $LastChangedBy: sixcooler $
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

@ -3,9 +3,9 @@
* Copyright 2010 by Sebastian Gaebel
* First released 01.07.2010 at http://yacy.net
*
* $LastChangedDate: 2010-06-16 17:11:21 +0200 (Mi, 16 Jun 2010) $
* $LastChangedRevision: 7001 $
* $LastChangedBy: sixcooler $
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

@ -3,9 +3,9 @@
* Copyright 2010 by Sebastian Gaebel
* First released 01.07.2010 at http://yacy.net
*
* $LastChangedDate: 2010-06-16 17:11:21 +0200 (Mi, 16 Jun 2010) $
* $LastChangedRevision: 7001 $
* $LastChangedBy: sixcooler $
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

@ -3,9 +3,9 @@
* Copyright 2010 by Sebastian Gaebel
* First released 01.07.2010 at http://yacy.net
*
* $LastChangedDate: 2010-06-16 17:11:21 +0200 (Mi, 16 Jun 2010) $
* $LastChangedRevision: 7020 $
* $LastChangedBy: sixcooler $
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen
* First released 25.05.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2011 by Michael Peter Christen
* First released 2.01.2011 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen
* First released 25.05.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen
* First released 07.01.2011 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen
* First released 25.05.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General private
* License as published by the Free Software Foundation; either
@ -126,6 +130,7 @@ public class SearchHub {
* return a hash code of the search hub.
* This is computed using only the query string because that identifies the object
*/
@Override
public int hashCode() {
return query.hashCode();
}

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen
* First released 06.01.2011 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -92,6 +96,7 @@ public class SearchSRURSS extends Thread implements SearchAccumulator {
this.userAgent = userAgent;
}
@Override
public void run() {
searchSRURSS(results, urlBase, query, timeoutInit, maximumRecordsInit, verify, global, userAgent);
int p = 1;
@ -119,6 +124,7 @@ public class SearchSRURSS extends Thread implements SearchAccumulator {
final boolean global,
final String userAgent) {
Thread job = new Thread() {
@Override
public void run() {
int startRecord = 0;
RSSMessage message;

@ -4,6 +4,10 @@
* Copyright 2009 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 29.08.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -4,6 +4,10 @@
* Copyright 2010 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 24.08.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -45,9 +49,11 @@ public final class ComparableARC<K, V> extends SimpleARC<K, V> implements Map<K,
this.limit = cacheSize;
this.keys = new LinkedList<K>();
}
@Override
public synchronized V get(Object k) {
return super.get(k);
}
@Override
public synchronized V put(K k, V v) {
V r = super.put(k, v);
if (r == null) keys.add(k);
@ -59,9 +65,11 @@ public final class ComparableARC<K, V> extends SimpleARC<K, V> implements Map<K,
}
return r;
}
@Override
public void putAll(Map<? extends K, ? extends V> map) {
for (Map.Entry<? extends K, ? extends V> entry: map.entrySet()) put(entry.getKey(), entry.getValue());
}
@Override
public synchronized V remove(Object k) {
V r = super.remove(k);
if (r == null) return null;
@ -70,18 +78,21 @@ public final class ComparableARC<K, V> extends SimpleARC<K, V> implements Map<K,
assert removed;
return r;
}
@Override
public synchronized Map.Entry<K,V> pollFirstEntry() {
Map.Entry<K,V> entry = super.pollFirstEntry();
boolean removed = removeFromKeys(entry.getKey());
assert removed;
return entry;
}
@Override
public synchronized Map.Entry<K,V> pollLastEntry() {
Map.Entry<K,V> entry = super.pollLastEntry();
boolean removed = removeFromKeys(entry.getKey());
assert removed;
return entry;
}
@Override
public synchronized void clear() {
super.clear();
this.keys.clear();

@ -3,6 +3,10 @@
* Copyright 2009 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 17.04.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -93,6 +97,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
* @param s
* @param v
*/
@Override
public final V put(final K s, final V v) {
return this.arc[getPartition(s)].put(s, v);
}
@ -103,6 +108,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
* @return the value
*/
@SuppressWarnings("unchecked")
@Override
public final V get(final Object s) {
return this.arc[getPartition(s)].get((K) s);
}
@ -124,6 +130,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
* @return
*/
@SuppressWarnings("unchecked")
@Override
public final boolean containsKey(final Object s) {
return this.arc[getPartition(s)].containsKey((K) s);
}
@ -134,6 +141,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
* @return the old value
*/
@SuppressWarnings("unchecked")
@Override
public final V remove(final Object s) {
return this.arc[getPartition(s)].remove((K) s);
}
@ -141,6 +149,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
/**
* clear the cache
*/
@Override
public final void clear() {
for (ARC<K, V> a: this.arc) a.clear();
}
@ -149,6 +158,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
* get the size of the ARC.
* @return the complete number of entries in the ARC cache
*/
@Override
public final int size() {
int s = 0;
for (ARC<K, V> a: this.arc) s += a.size();
@ -182,6 +192,7 @@ public final class ConcurrentARC<K, V> extends AbstractMap<K, V> implements Map<
* a hash code for this ARC
* @return a hash code
*/
@Override
public int hashCode() {
return this.arc.hashCode();
}

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
* First released 14.10.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -4,6 +4,10 @@
* Copyright 2009 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 17.04.2009 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
* First released 14.10.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -76,10 +80,12 @@ public class IntScore implements Comparable<IntScore>, Comparator<IntScore> {
if (n > this.value) this.value = n;
}
@Override
public boolean equals(Object o) {
return (o instanceof IntScore) && this.value == ((IntScore) o).value;
}
@Override
public int hashCode() {
return this.value;
// return (int) (this.value ^ (this.value >>> 32)); // hash code for long values
@ -95,6 +101,7 @@ public class IntScore implements Comparable<IntScore>, Comparator<IntScore> {
return o1.compareTo(o2);
}
@Override
public String toString() {
return Integer.toString(this.value);
}

@ -3,6 +3,10 @@
* Copyright 2006 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
* First released 17.01.2006 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2004, 2010 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
* First released 28.09.2004 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either

@ -3,6 +3,10 @@
* Copyright 2010 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
* First released 14.10.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -241,6 +245,7 @@ public class ScoreMap<E> implements DynamicScore<E> {
return minObject;
}
@Override
public String toString() {
return map.toString();
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save