package org.genericsystem.api.core;

/**
 * Represents the root of Generic System.
 *
 * @author Nicolas Feybesse
 *
 *
 * @param <T>
 *            the implementation of IRoot used for engine.
 */
public interface IRoot<T extends IVertex<T>> extends IVertex<T> {

	/**
	 * This Method returns a node reference of the generic system graph which
	 * corresponds to the class given as parameter. The node is statically
	 * created at startup should the java annotation @SystemGeneric has been
	 * positioned in the given Class. Thus the nodes created are permanently and
	 * fastly accessible through this method and are not removable.
	 *
	 * @param <Custom>
	 *            an implementation of a customizable subtype of T.
	 * @param clazz
	 *            the expected class that should have @SystemGeneric annotation.
	 * @return the vertex.
	 */
	<Custom extends T> Custom find(Class<?> clazz);

	/**
	 * Return a vertex built during new Root. If called during Root
	 * initialization, mount system node if nesscessary
	 *
	 * @param <Custom>
	 *            an implementation of a customizable subtype of T.
	 * @param clazz
	 *            the expected vertex.
	 * @return a vertex.
	 */
	<Custom extends T> Custom bind(Class<?> clazz);

	Class<?> findAnnotedClass(T vertex);

	/*
	 * T addType(Serializable value);
	 * 
	 * T addType(T override, Serializable value);
	 * 
	 * T addType(List<T> overrides, Serializable value);
	 * 
	 * T setType(Serializable value);
	 * 
	 * T setType(T override, Serializable value);
	 * 
	 * T setType(List<T> overrides, Serializable value);
	 */

	/**
	 * Return the meta attribute. The meta attribute is the super of all
	 * attributes.
	 *
	 * @return the meta attribute.
	 */
	T getMetaAttribute();

	/**
	 * Return the meta relation. The meta relation is the super of all
	 * relations.
	 *
	 * @return the meta relation.
	 */
	T getMetaRelation();

	/**
	 * Close the root. All changes done in the cache but not committed are
	 * automatically rollbacked. Persist the last state of the engine.
	 */
	void close();

	T getMap();
}

@@ -307,24 +307,24 @@
 nce 
-of
+in
  the 
-g
+G
 eneric 
-s
+S
 yste
@@ -560,23 +560,12 @@
 ntly
- and%0A%09 * fastly
+%0A%09 *
  acc
@@ -614,16 +614,98 @@
 movable.
+ It's a secure and%0A%09 * extremely fast way to a get a reference on a specific node.
 %0A%09 *%0A%09 *
@@ -736,37 +736,16 @@
         
-an implementation of 
 a custom
@@ -1354,33 +1354,32 @@
 able value);%0A%09 *
- 
 %0A%09 * T addType(T
@@ -1409,25 +1409,24 @@
  value);%0A%09 *
- 
 %0A%09 * T addTy
@@ -1463,33 +1463,32 @@
 able value);%0A%09 *
- 
 %0A%09 * T setType(S
@@ -1502,33 +1502,32 @@
 able value);%0A%09 *
- 
 %0A%09 * T setType(T
@@ -1561,17 +1561,16 @@
 ue);%0A%09 *
- 
 %0A%09 * T s

improve javadoc