Please take time to read the code disclaimer.
/**
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package encodequerygenerator;
import java.util.*;
/**
*
* @author Video
*/
public class LanguageType {
private String name;
private LinkedList languageList = new LinkedList();
public LanguageType(Language language) {
}
/**
* this method will rename all the languages of this type
* @param newName
*/
public void renameLanguage(String newName) {
for (Language language : languageList) {
language.setName(newName);
}
}
/**
* This method will reset the ignore status of all languages of this type
* @param newStatus
*/
public void resetIgnoreStatus(boolean newStatus) {
for (Language language : languageList) {
language.setIgnore(newStatus);
}
}
/**
* Gets the total languages ignored of this type
* @return
*/
public boolean isMostIgnored() {
if (getNumberIgnored() > languageList.size()) {
return true;
} else {
return false;
}
}
/**
* Gets the total languages ignored of this type
* @return
*/
public int getNumberIgnored() {
int countIgnored = 0;
for (Language language : languageList) {
if (language.isIgnore()) {
countIgnored++;
}
}
return countIgnored;
}
/**
* Sets all the languages of this type to have the ignore state given.
* @param ignore
*/
public void ignoreAll(boolean ignore) {
for (Language language : languageList) {
language.setIgnore(ignore);
}
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the languageList
*/
public LinkedList getLanguageList() {
return languageList;
}
/**
* @param languageList the languageList to set
*/
public void setLanguageList(LinkedList languageList) {
this.languageList = languageList;
}
}