yacy_search_server/source/de/anomic/search/ContentDomain.java
low012 82198acc06 *) minor changes
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6537 6c8d7289-2bf4-0310-a012-ef5d649a1542
2009-12-28 11:06:49 +00:00

41 lines
958 B
Java

package de.anomic.search;
public enum ContentDomain {
ALL(-1),
TEXT(0),
IMAGE(1),
AUDIO(2),
VIDEO(3),
APP(4);
private int code;
ContentDomain(int code) {
this.code = code;
}
public int getCode() {
return this.code;
}
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;
return TEXT;
}
@Override
public String toString() {
if (this == TEXT) return "text";
else if (this == IMAGE) return "image";
else if (this == AUDIO) return "audio";
else if (this == VIDEO) return "video";
else if (this == APP) return "app";
return "text";
}
}