Commit 967a2867 authored by David Novak's avatar David Novak
Browse files

added support for switching Loc2int convertor

parent 3024806d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

    <groupId>mindex</groupId>
    <artifactId>ppp-codes</artifactId>
    <version>1.3.1-DEVEL</version>
    <version>1.3.2-DEVEL</version>
    <packaging>jar</packaging>

    <name>ppp-codes</name>
+0 −2
Original line number Diff line number Diff line
@@ -138,8 +138,6 @@ public class PPPCodeIndex extends MetricIndex {
    @SuppressWarnings({"FinalizeDeclaration", "FinalizeCalledExplicitly"})
    public void finalize() throws Throwable {
        // NEVER PUT CONSOLIDATE DATA IN FINALIZE, BECAUSE IT WOULD BE CALLED AFTER THE SERIALIZATION
//        consolidateTreeData();
//        System.out.println("consolidating data in one PPP-Tree");
        super.finalize();
    }
    
+11 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public class PPPCodeAlgorithm extends MultipleOverlaysAlgorithm {
    protected List<PPPCodeSingleAlgorithm> algorithms;

    /** Translator of string locators to unique integer IDs and back again. */
    protected final LocatorStringIntConvertor locatorConvertor;
    protected LocatorStringIntConvertor locatorConvertor;
    
    /** A simple lock for periodic algorithm serialization. */
    protected transient Lock serializingLock = new ReentrantLock();
@@ -186,6 +186,16 @@ public class PPPCodeAlgorithm extends MultipleOverlaysAlgorithm {
        Logger.getLogger(PPPCodeAlgorithm.class.getName()).log(Level.INFO, "leaf disk storage set to: {0}", leafStorage.getFile());
    }

    /**
     * Sets a new locator convertor for this PPP-Code algorithm. Use this method only if you very
     *  well know, what you're doing so that the serialized data is still compatible with the new 
     *  convertor.
     * @param locatorConvertor new convertor from string locators to the integer ones.
     */
    public void setLocatorConvertor(LocatorStringIntConvertor locatorConvertor) {
        this.locatorConvertor = locatorConvertor;
    }
    
    // **********************************       Overriding methods      ******************************* //
    
    @Override
+1 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ public class PPPCodeInternalCell extends VoronoiInternalCell {
        }
    }

    // **********************    For testing purposes    ********************* //
    
    public void findObject(int id) {
        for (Iterator<Map.Entry<Short, VoronoiCell>> childNodes = getChildNodes(); childNodes.hasNext(); ) {