*) adding more SVN properties

*) minor changes

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6540 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 15 years ago
parent dcb1096fb0
commit e04cb8cef0

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-03-20 16:44:59 +0100 (Fr, 20 Mrz 2009) $
// $LastChangedRevision: 5736 $
// $LastChangedBy: borg-0300 $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -117,6 +117,7 @@ public final class CitationReferenceRow implements Reference /*, Cloneable*/ {
this.entry = rentry;
}
@Override
public CitationReferenceRow clone() {
final byte[] b = new byte[citationRow.objectsize];
System.arraycopy(entry.bytes(), 0, b, 0, citationRow.objectsize);
@ -167,6 +168,7 @@ public final class CitationReferenceRow implements Reference /*, Cloneable*/ {
return 1.0 / ((double) (llocal() + lother() + 1));
}
@Override
public String toString() {
return toPropertyForm();
}
@ -177,11 +179,13 @@ public final class CitationReferenceRow implements Reference /*, Cloneable*/ {
return false;
}
@Override
public int hashCode() {
return this.metadataHash().hashCode();
}
public boolean equals(Object obj) {
@Override
public boolean equals(final Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (!(obj instanceof CitationReferenceRow)) return false;

@ -3,8 +3,8 @@
// first published 13.07.2006 on http://yacy.net
//
// $LastChangedDate: 2009-10-10 01:22:22 +0200 (Sa, 10 Okt 2009) $
// $LastChangedRevision: 6392 $
// $LastChangedBy: orbiter $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -57,11 +57,12 @@ public class DigestURI implements Serializable {
private String protocol, host, userInfo, path, quest, ref, hash;
private int port;
public static String domhash(String host) {
if (!host.startsWith("http://")) host = "http://" + host;
public static String domhash(final String host) {
String h = host;
if (!h.startsWith("http://")) h = "http://" + h;
DigestURI url = null;
try {
url = new DigestURI(host, null);
url = new DigestURI(h, null);
} catch (MalformedURLException e) {
Log.logException(e);
return null;
@ -83,7 +84,7 @@ public class DigestURI implements Serializable {
parseURLString(url);
this.hash = hash;
}
private void parseURLString(String url) throws MalformedURLException {
// identify protocol
assert (url != null);
@ -295,9 +296,10 @@ public class DigestURI implements Serializable {
escape();
}
// resolve '..'
public String resolveBackpath(String path) /* throws MalformedURLException */ {
public String resolveBackpath(final String path) {
String p = path;
/* original version by [MC]
int p;
while ((p = path.indexOf("/..")) >= 0) {
@ -308,15 +310,15 @@ public class DigestURI implements Serializable {
}*/
/* by [MT] */
if (path.length() == 0 || path.charAt(0) != '/') { path = "/" + path; }
if (p.length() == 0 || p.charAt(0) != '/') { p = "/" + p; }
final Matcher matcher = backPathPattern.matcher(path);
final Matcher matcher = backPathPattern.matcher(p);
while (matcher.find()) {
path = matcher.replaceAll("");
matcher.reset(path);
p = matcher.replaceAll("");
matcher.reset(p);
}
return path.equals("")?"/":path;
return p.equals("")?"/":p;
}
/**
@ -629,6 +631,7 @@ public class DigestURI implements Serializable {
return quest;
}
@Override
public String toString() {
return toNormalform(false, true);
}
@ -924,7 +927,7 @@ public class DigestURI implements Serializable {
return domDomain(this.hash) == 7;
}
public static final boolean isLocal(String urlhash) {
public static final boolean isLocal(final String urlhash) {
return domDomain(urlhash) == 7;
}

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-03-20 16:44:59 +0100 (Fr, 20 Mrz 2009) $
// $LastChangedRevision: 5736 $
// $LastChangedBy: borg-0300 $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -82,6 +82,7 @@ public interface URIMetadata {
public String toString(final String snippet);
@Override
public String toString();
}

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-03-20 16:44:59 +0100 (Fr, 20 Mrz 2009) $
// $LastChangedRevision: 5736 $
// $LastChangedBy: borg-0300 $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -502,6 +502,7 @@ public class URIMetadataRow implements URIMetadata {
* This e.g. looks like this:
* <pre>{hash=jmqfMk7Y3NKw,referrer=------------,mod=20050610,load=20051003,size=51666,wc=1392,cc=0,local=true,q=AEn,dt=h,lang=uk,url=b|aHR0cDovL3d3dy50cmFuc3BhcmVuY3kub3JnL3N1cnZleXMv,descr=b|S25vd2xlZGdlIENlbnRyZTogQ29ycnVwdGlvbiBTdXJ2ZXlzIGFuZCBJbmRpY2Vz}</pre>
*/
@Override
public String toString() {
final StringBuilder core = corePropList();
if (core == null) return null;

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-04-03 15:23:45 +0200 (Fr, 03 Apr 2009) $
// $LastChangedRevision: 5777 $
// $LastChangedBy: orbiter $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -43,12 +43,14 @@ public interface NavigationReference extends Reference {
public int hitcount();
public int position(int p);
public int position(final int p);
public byte flags();
@Override
public String toString();
@Override
public int hashCode();
}

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-04-03 15:23:45 +0200 (Fr, 03 Apr 2009) $
// $LastChangedRevision: 5777 $
// $LastChangedBy: orbiter $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -32,11 +32,11 @@ import net.yacy.kelondro.rwi.ReferenceFactory;
public class NavigationReferenceFactory implements ReferenceFactory<NavigationReference> {
public NavigationReference produceSlow(Entry e) {
public NavigationReference produceSlow(final Entry e) {
return new NavigationReferenceRow(e);
}
public NavigationReference produceFast(NavigationReference r) {
public NavigationReference produceFast(final NavigationReference r) {
if (r instanceof NavigationReferenceVars) return r;
return new NavigationReferenceVars(r);
}

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-03-20 16:44:59 +0100 (Fr, 20 Mrz 2009) $
// $LastChangedRevision: 5736 $
// $LastChangedBy: borg-0300 $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -96,10 +96,11 @@ public final class NavigationReferenceRow extends AbstractReference implements N
this.entry = navEntryRow.newEntry(row);
}
public NavigationReferenceRow(Row.Entry entry) {
public NavigationReferenceRow(final Row.Entry entry) {
this.entry = entry;
}
@Override
public NavigationReferenceRow clone() {
final byte[] b = new byte[navEntryRow.objectsize];
System.arraycopy(entry.bytes(), 0, b, 0, navEntryRow.objectsize);
@ -130,7 +131,7 @@ public final class NavigationReferenceRow extends AbstractReference implements N
return (int) this.entry.getColLong(col_count);
}
public int position(int p) {
public int position(final int p) {
assert p == 0 : "p = " + p;
return (int) this.entry.getColLong(col_pos);
}
@ -139,14 +140,17 @@ public final class NavigationReferenceRow extends AbstractReference implements N
return (byte) this.entry.getColLong(col_flags);
}
@Override
public String toString() {
return toPropertyForm();
}
@Override
public int hashCode() {
return this.navigationHash().hashCode();
}
@Override
public boolean equals(final Object obj) {
if (this == obj) return true;
if (obj == null) return false;
@ -155,14 +159,14 @@ public final class NavigationReferenceRow extends AbstractReference implements N
return this.navigationHash().equals(other.navigationHash());
}
public boolean isOlder(Reference other) {
public boolean isOlder(final Reference other) {
return false;
}
// unsupported operations:
public void join(Reference oe) {
public void join(final Reference oe) {
throw new UnsupportedOperationException();
}

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-03-20 16:44:59 +0100 (Fr, 20 Mrz 2009) $
// $LastChangedRevision: 5736 $
// $LastChangedBy: borg-0300 $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -58,6 +58,7 @@ public class NavigationReferenceVars extends AbstractReference implements Navig
this.flags = e.flags();
}
@Override
public NavigationReferenceVars clone() {
final NavigationReferenceVars c = new NavigationReferenceVars(
this.termhash,
@ -102,7 +103,7 @@ public class NavigationReferenceVars extends AbstractReference implements Navig
return this.hitcount;
}
public int position(int p) {
public int position(final int p) {
assert p == 0 : "p = " + p;
return this.position;
}
@ -111,14 +112,17 @@ public class NavigationReferenceVars extends AbstractReference implements Navig
return this.flags;
}
@Override
public String toString() {
return toPropertyForm();
}
@Override
public int hashCode() {
return this.navigationHash().hashCode();
}
@Override
public boolean equals(final Object obj) {
if (this == obj) return true;
if (obj == null) return false;
@ -127,14 +131,14 @@ public class NavigationReferenceVars extends AbstractReference implements Navig
return this.navigationHash().equals(other.navigationHash());
}
public boolean isOlder(Reference other) {
public boolean isOlder(final Reference other) {
return false;
}
// unsupported operations:
public void join(Reference oe) {
public void join(final Reference oe) {
throw new UnsupportedOperationException();
}

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-10-10 03:14:19 +0200 (Sa, 10 Okt 2009) $
// $LastChangedRevision: 6397 $
// $LastChangedBy: orbiter $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-04-03 15:23:45 +0200 (Fr, 03 Apr 2009) $
// $LastChangedRevision: 5777 $
// $LastChangedBy: orbiter $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-04-03 15:23:45 +0200 (Fr, 03 Apr 2009) $
// $LastChangedRevision: 5777 $
// $LastChangedBy: orbiter $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -32,11 +32,11 @@ import net.yacy.kelondro.rwi.ReferenceFactory;
public class WordReferenceFactory implements ReferenceFactory<WordReference> {
public WordReference produceSlow(Entry e) {
public WordReference produceSlow(final Entry e) {
return new WordReferenceRow(e);
}
public WordReference produceFast(WordReference r) {
public WordReference produceFast(final WordReference r) {
if (r instanceof WordReferenceVars) return r;
return new WordReferenceVars(r);
}

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-03-20 16:44:59 +0100 (Fr, 20 Mrz 2009) $
// $LastChangedRevision: 5736 $
// $LastChangedBy: borg-0300 $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -218,6 +218,7 @@ public final class WordReferenceRow extends AbstractReference implements WordRef
this.entry = rentry;
}
@Override
public WordReferenceRow clone() {
final byte[] b = new byte[urlEntryRow.objectsize];
System.arraycopy(entry.bytes(), 0, b, 0, urlEntryRow.objectsize);
@ -256,7 +257,7 @@ public final class WordReferenceRow extends AbstractReference implements WordRef
return 1;
}
public int position(int p) {
public int position(final int p) {
assert p == 0 : "p = " + p;
return (int) this.entry.getColLong(col_posintext);
}
@ -313,6 +314,7 @@ public final class WordReferenceRow extends AbstractReference implements WordRef
return (((double) this.hitcount()) / ((double) (this.wordsintext() + this.wordsintitle() + 1)));
}
@Override
public String toString() {
return toPropertyForm();
}
@ -323,6 +325,7 @@ public final class WordReferenceRow extends AbstractReference implements WordRef
return false;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) return true;
if (obj == null) return false;
@ -331,11 +334,12 @@ public final class WordReferenceRow extends AbstractReference implements WordRef
return this.metadataHash().equals(other.metadataHash());
}
@Override
public int hashCode() {
return this.metadataHash().hashCode();
}
public void join(Reference oe) {
public void join(final Reference oe) {
throw new UnsupportedOperationException("");
}

@ -5,8 +5,8 @@
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2009-03-20 16:44:59 +0100 (Fr, 20 Mrz 2009) $
// $LastChangedRevision: 5736 $
// $LastChangedBy: borg-0300 $
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -59,7 +59,7 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
public double termFrequency;
public WordReferenceVars(
final String urlHash,
final String urlHash,
final int urlLength, // byte-length of complete URL
final int urlComps, // number of path components
final int titleLength, // length of description/length (longer are better?)
@ -150,6 +150,7 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
this.termFrequency = 0.0;
}
@Override
public WordReferenceVars clone() {
final WordReferenceVars c = new WordReferenceVars(
this.urlHash,
@ -233,7 +234,7 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
return this.positions.size();
}
public int position(int p) {
public int position(final int p) {
return this.positions.get(p);
}
@ -358,6 +359,7 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
this.wordsintext = this.wordsintext + oe.wordsintext();
}
@Override
public boolean equals(final Object obj) {
if (this == obj) return true;
if (obj == null) return false;
@ -366,15 +368,16 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
return this.urlHash.equals(other.urlHash);
}
@Override
public int hashCode() {
return this.urlHash.hashCode();
}
public int compareTo(WordReferenceVars o) {
public int compareTo(final WordReferenceVars o) {
return Base64Order.enhancedCoder.compare(this.urlHash.getBytes(), o.metadataHash().getBytes());
}
public void addPosition(int position) {
public void addPosition(final int position) {
this.positions.add(position);
}
@ -413,11 +416,12 @@ public class WordReferenceVars extends AbstractReference implements WordReferenc
BlockingQueue<WordReferenceRow> in;
BlockingQueue<WordReferenceVars> out;
public Transformer(BlockingQueue<WordReferenceRow> in, BlockingQueue<WordReferenceVars> out) {
public Transformer(final BlockingQueue<WordReferenceRow> in, final BlockingQueue<WordReferenceVars> out) {
this.in = in;
this.out = out;
}
@Override
public void run() {
WordReferenceRow row;
try {

Loading…
Cancel
Save