<commit_before>package org.eclipse.dawnsci.nexus;

import org.eclipse.dawnsci.nexus.builder.AbstractNexusProvider;
import org.eclipse.dawnsci.nexus.builder.DelegateNexusProvider;
import org.eclipse.dawnsci.nexus.builder.NexusObjectProvider;

/**
 * Any device which can write NeXus should implement this method.
 * 
 * This can be done easily by using {@link AbstractNexusProvider} or
 * {@link DelegateNexusProvider}
 * 
 * @author <NAME>
 *
 */
public interface INexusDevice<N extends NXobject> {

	/**
	 * The object provider required for writing correct nexus files.
	 * @return
	 * @throws Exception
	 */
	NexusObjectProvider<N> getNexusProvider(NexusScanInfo info) ;
	
	/**
	 * 
	 * @param nodeFactory
	 * @return
	 */
	N createNexusObject(NexusNodeFactory nodeFactory, NexusScanInfo info);

}<commit_msg>Add JavaDoc to INexusDevice<commit_after>package org.eclipse.dawnsci.nexus;

import org.eclipse.dawnsci.analysis.dataset.impl.LazyDataset;
import org.eclipse.dawnsci.nexus.builder.AbstractNexusProvider;
import org.eclipse.dawnsci.nexus.builder.DelegateNexusProvider;
import org.eclipse.dawnsci.nexus.builder.NexusObjectProvider;

/**
 * Any device which can write NeXus should implement this interface.
 * 
 * This can be done easily by extending {@link AbstractNexusProvider} or
 * {@link DelegateNexusProvider}
 * 
 * @author <NAME>
 *
 */
public interface INexusDevice<N extends NXobject> {

	/**
	 * The object provider required for writing correct NeXus files.
	 * @return
	 * @throws Exception
	 */
	NexusObjectProvider<N> getNexusProvider(NexusScanInfo info) ;
	
	/**
	 * <p>
	 * In this method you should prepare the {@link LazyDataset}s the device
	 * will fill during the scan. You can also write out static device metadata,
	 * which will not change during the scan.
	 * </p>
	 * <p>
	 * Use the provided <code>nodeFactory</code> to create a NeXus object which
	 * matches the device e.g. a {@link NXdetector}.
	 * <code>final NXdetector detector = nodeFactory.createNXdetector();</code>
	 * </p>
	 * <p>
	 * On the detector object you can create {@link LazyDataset}s and keep
	 * references which you can later use during the scan to write data. e.g.
	 * <code>imageData = detector.initializeLazyDataset(NXdetector.NX_DATA, info.getRank() + 2, Dataset.FLOAT64);</code>
	 * You should also set chunking on the {@link LazyDataset}s you create e.g. <code>imageData.setChunking(info.createChunk(detectorXSize, detectorYSize));</code>.
	 * </p>
	 * In this method you can also write static metadata such as the detector
	 * exposure e.g.
	 * <code>detector.setField("exposure_time", model.getExposure());</code>. Or
	 * static datasets such as the image axis data
	 * <code>detector.setDataset("image_x_axis", DatasetFactory.createLinearSpace(minX, maxX, xPoints, Dataset.FLOAT64));</code>
	 * <p>
	 * 
	 * @param nodeFactory
	 *            Factory you can use to create an appropriate NeXus node
	 * @param info
	 *            Information about the scan which can be useful when creating
	 *            dataset e.g. <code>info.getRank()</code>
	 * @return The {@link NXobject} created using the <code>nodeFactory</code>
	 *         to represent this device
	 */
	N createNexusObject(NexusNodeFactory nodeFactory, NexusScanInfo info);

}
{'fraction_non_alphanumeric': 0.10414746543778802, 'fraction_numerical': 0.0015360983102918587, 'mean_word_length': 4.135646687697161, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3837178', 'n_tokens_mistral': 1062, 'n_tokens_neox': 988, 'n_words': 294}