@Test public void testFlatten_01() { DocumentFlattener df = new DocumentFlattener(new Path(new String[0]), 1); List<EntityObject> records = df.flatten(taxon); assertEquals("01", 1, records.size()); assertTrue("02", records.get(0).getEntity() == taxon); assertTrue("03", records.get(0).getDocument() == taxon); }
public List<EntityObject> flatten(Object document) throws InvalidPathException { if (pathToEntity == null) { return Arrays.asList(new EntityObject(document)); } List<EntityObject> entityNodes = new ArrayList<>(entitiesPerDocument); EntityObject root = new EntityObject(document); flatten(root, pathToEntity, entityNodes); return entityNodes; }
DocumentFlattener { public List<EntityObject> flatten(Object document) throws InvalidPathException { if (pathToEntity == null) { return Arrays.asList(new EntityObject(document)); } List<EntityObject> entityNodes = new ArrayList<>(entitiesPerDocument); EntityObject root = new EntityObject(document); flatten(root, pathToEntity, entityNodes); return entityNodes; } }
DocumentFlattener { public List<EntityObject> flatten(Object document) throws InvalidPathException { if (pathToEntity == null) { return Arrays.asList(new EntityObject(document)); } List<EntityObject> entityNodes = new ArrayList<>(entitiesPerDocument); EntityObject root = new EntityObject(document); flatten(root, pathToEntity, entityNodes); return entityNodes; } DocumentFlattener();  DocumentFlattener(Path pathToEntity);  DocumentFlattener(Path pathToEntity, int entitiesPerDocument); }
DocumentFlattener { public List<EntityObject> flatten(Object document) throws InvalidPathException { if (pathToEntity == null) { return Arrays.asList(new EntityObject(document)); } List<EntityObject> entityNodes = new ArrayList<>(entitiesPerDocument); EntityObject root = new EntityObject(document); flatten(root, pathToEntity, entityNodes); return entityNodes; } DocumentFlattener();  DocumentFlattener(Path pathToEntity);  DocumentFlattener(Path pathToEntity, int entitiesPerDocument); List<EntityObject> flatten(Object document); }
DocumentFlattener { public List<EntityObject> flatten(Object document) throws InvalidPathException { if (pathToEntity == null) { return Arrays.asList(new EntityObject(document)); } List<EntityObject> entityNodes = new ArrayList<>(entitiesPerDocument); EntityObject root = new EntityObject(document); flatten(root, pathToEntity, entityNodes); return entityNodes; } DocumentFlattener();  DocumentFlattener(Path pathToEntity);  DocumentFlattener(Path pathToEntity, int entitiesPerDocument); List<EntityObject> flatten(Object document);  }