All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fr.vergne.translation.TranslationMap Maven / Gradle / Ivy

The newest version!
package fr.vergne.translation;

import java.io.File;
import java.util.Iterator;

/**
 * A {@link TranslationMap} describes a purpose-dedicated set of
 * {@link TranslationEntry}s. In other words, it represents a set of
 * {@link TranslationEntry}s which are somehow related, typically because they
 * relate to a specific scene or similar, so they order matter.
 * 
 * @author Matthieu VERGNE 
 * 
 * @param 
 */
public interface TranslationMap> extends
		Iterable {

	/**
	 * This method should return an {@link Iterator} which provides all the
	 * {@link Entry}s that should be translated. Moreover, they should be in the
	 * "right order", meaning that if the {@link TranslationMap} is built from
	 * an existing {@link File}, this {@link Iterator} should provide the
	 * corresponding {@link Entry}s in the same order.
	 */
	@Override
	public Iterator iterator();

	/**
	 * This method aims at providing the requested {@link Entry} of the current
	 * {@link TranslationMap}. The first entry is at the index 0 and the entries
	 * are in the same order than for {@link #iterator()}.
	 * 
	 * @param index
	 *            the index of the {@link Entry}
	 * @return the corresponding {@link Entry}
	 */
	public Entry getEntry(int index);

	/**
	 * @return the number of {@link Entry}s in this {@link TranslationMap}
	 */
	public int size();

	/**
	 * This method should be equivalent to calling
	 * {@link TranslationEntry#saveAll()} for each {@link TranslationEntry} of
	 * this {@link TranslationMap} in an atomic way, thus reducing the overhead
	 * of calling each one separately.
	 */
	public void saveAll();

	/**
	 * This method should be equivalent to calling
	 * {@link TranslationEntry#resetAll()} for each {@link TranslationEntry} of
	 * this {@link TranslationMap} in an atomic way, thus reducing the overhead
	 * of calling each one separately.
	 */
	public void resetAll();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy