📄 section.java.svn-base
字号:
/*
* Section.java
*
* Created on 28. Januar 2007, 21:29
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package kanjitori.lesson;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* This class encapsulates a group of entries, subdividing a lesson.
* @author Pirx
*/
public class Section implements Iterable<Entry> {
private String name;
private List<Entry> list;
private boolean included = true;
/**
* Creates a new instance of section
* @param name The name of the section. Spaces should be avoided.
*/
public Section(String name) {
this(name, new ArrayList<Entry>());
}
/**
* Creates a new instance of section
* @param name The name of the section. Spaces should be avoided.
* @param list The list of entries
*/
public Section(String name, List<Entry> list) {
this.name = name;
this.list = list;
}
/**
* Getter for the name.
* @return The name of the Section
*/
public String getName() {
return name;
}
/**
* Adds an Entry to the Entry list.
* @param entry The Entry which should be added.
*/
public void addEntry(Entry entry) {
list.add(entry);
}
/**
* Number of Entries
* @return The number of Entries.
*/
public int size() {
return list.size();
}
/**
* Getter for an Entry.
* @param index The index of the Entry.
* @return The Entry at the specified position.
*/
public Entry getEntry(int index) {
return list.get(index);
}
/**
* Implements the Iterable<Entry> interface.
* @return The iterator of the Entry list.
*/
public Iterator<Entry> iterator() {
return list.iterator();
}
/**
* Getter for the "included" property. If true, the section
* will be used if the lesson is loaded.
* @return true if this section will be used.
*/
public boolean isIncluded() {
return included;
}
/**
* Setter for the "included" property. If true, the section
* will be used if the lesson is loaded.
* @param included If true, this section will be used.
*/
public void setIncluded(boolean included) {
this.included = included;
}
/**
* Getter for the entry list.
* @return the list of entries.
*/
public List<Entry> getEntries() {
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -