00001
00002 package de.aitools.aq.invertedindex.core;
00003
00004 import java.io.PrintStream;
00005
00006 import com.sun.jna.Structure;
00007
00008 import de.aitools.aq.invertedindex.core.Configuration.ValueSorting;
00009
00014 public final class Properties {
00015
00016 protected static final class PropertiesImpl extends Structure {
00017
00018 public int valueSorting;
00019 public int versionNumber;
00020 public byte[] valueType;
00021 public long valueCount;
00022 public long totalSize;
00023 public long keyCount;
00024 }
00025
00026 protected Properties() {
00027 impl = new PropertiesImpl();
00028 impl.valueType = new byte[64];
00029 }
00030
00039 public long getKeyCount() {
00040 return impl.keyCount;
00041 }
00042
00049 public long getTotalSize() {
00050 return impl.totalSize;
00051 }
00052
00059 public long getValueCount() {
00060 return impl.valueCount;
00061 }
00062
00069 public ValueSorting getValueSorting() {
00070 return ValueSorting.values()[impl.valueSorting];
00071 }
00072
00079 public String getValueType() {
00080 return new String(impl.valueType);
00081 }
00082
00088 public int getVersionNumber() {
00089 return impl.versionNumber;
00090 }
00091
00099 public PrintStream printTo(PrintStream stream) {
00100 stream.format("valueType : %1$s\n", getValueType());
00101 stream.format("valueSorting : %1$s\n", getValueSorting());
00102 stream.format("versionNumber : %1$d\n", getVersionNumber());
00103 stream.format("totalSize : %1$d\n", getTotalSize());
00104 stream.format("valueCount : %1$d\n", getValueCount());
00105 stream.format("keyCount : %1$d", getKeyCount());
00106 return stream;
00107 }
00108
00109 protected PropertiesImpl impl;
00110 }