package org.kevoree.modeling;

import org.kevoree.modeling.memory.manager.KDataManager;
import org.kevoree.modeling.meta.KMetaAttribute;
import org.kevoree.modeling.meta.KMetaClass;
import org.kevoree.modeling.meta.KMetaOperation;
import org.kevoree.modeling.meta.KMetaReference;
import org.kevoree.modeling.traversal.KTraversal;
import org.kevoree.modeling.traversal.visitor.KModelAttributeVisitor;
import org.kevoree.modeling.traversal.visitor.KModelVisitor;

public interface KObject {

    long universe();

    long now();

    long uuid();

    void delete(KCallback cb);

    void select(String query, KCallback<Object[]> cb);

    void visitAttributes(KModelAttributeVisitor visitor);

    void visit(KModelVisitor visitor, KCallback cb);

    KMetaClass metaClass();

    void mutate(KActionType actionType, KMetaReference metaReference, KObject param);

    void ref(KMetaReference metaReference, KCallback<KObject[]> cb);

    KTraversal traversal();

    Object get(KMetaAttribute attribute);

    Object getByName(String atributeName);

    void set(KMetaAttribute attribute, Object payload);

    void setByName(String atributeName, Object payload);

    long[] getRefValuesByName(String refName);

    String toJSON();

    boolean equals(Object other);

    void jump(long time, KCallback<KObject> callback);

    KMetaReference[] referencesWith(KObject o);

    void call(KMetaOperation operation, Object[] params, KCallback<Object> cb);

    KDataManager manager();

    long timeDephasing();

    void allTimes(KCallback<long[]> cb);

    void timesBefore(long endOfSearch,KCallback<long[]> cb);

    void timesAfter(long beginningOfSearch,KCallback<long[]> cb);

    void timesBetween(long beginningOfSearch,long endOfSearch,KCallback<long[]> cb);

}

@@ -483,16 +483,50 @@
 ject %7B%0A%0A
+    /** KObject identification */%0A
     long
@@ -582,91 +582,83 @@
     
-void delete(KCallback cb);%0A%0A    void select(String query, KCallback%3CObject%5B%5D%3E cb);%0A
+KMetaClass metaClass();%0A%0A    /** Visitor, KTraversal and Jump strategies */
 %0A   
@@ -772,39 +772,287 @@
 ;%0A%0A    K
-MetaClass metaClass();%0A
+Traversal traversal();%0A%0A    void jump(long time, KCallback%3CKObject%3E callback);%0A%0A    /** Selector are untyped version of traversal */%0A    void select(String query, KCallback%3CObject%5B%5D%3E cb);%0A%0A    /** Delete KObject */%0A    void delete(KCallback cb);%0A%0A    /** Reflexive API */
 %0A    voi
@@ -1205,37 +1205,8 @@
 );%0A%0A
-    KTraversal traversal();%0A%0A
     
@@ -1447,24 +1447,383 @@
  refName);%0A%0A
+    /** Time related naviguation */%0A    long timeDephasing();%0A%0A    void allTimes(KCallback%3Clong%5B%5D%3E cb);%0A%0A    void timesBefore(long endOfSearch, KCallback%3Clong%5B%5D%3E cb);%0A%0A    void timesAfter(long beginningOfSearch, KCallback%3Clong%5B%5D%3E cb);%0A%0A    void timesBetween(long beginningOfSearch, long endOfSearch, KCallback%3Clong%5B%5D%3E cb);%0A%0A    /** Bulk KObject management */%0A
     String t
@@ -1871,64 +1871,8 @@
 );%0A%0A
-    void jump(long time, KCallback%3CKObject%3E callback);%0A%0A
     
@@ -2030,290 +2030,9 @@
 );%0A%0A
-    long timeDephasing();%0A%0A    void allTimes(KCallback%3Clong%5B%5D%3E cb);%0A%0A    void timesBefore(long endOfSearch,KCallback%3Clong%5B%5D%3E cb);%0A%0A    void timesAfter(long beginningOfSearch,KCallback%3Clong%5B%5D%3E cb);%0A%0A    void timesBetween(long beginningOfSearch,long endOfSearch,KCallback%3Clong%5B%5D%3E cb);
+%0A
 %0A%0A%7D%0A

add comment to API