001: /*
002: * Jacareto Copyright (c) 2002-2005
003: * Applied Computer Science Research Group, Darmstadt University of
004: * Technology, Institute of Mathematics & Computer Science,
005: * Ludwigsburg University of Education, and Computer Based
006: * Learning Research Group, Aachen University. All rights reserved.
007: *
008: * Jacareto is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU General Public
010: * License as published by the Free Software Foundation; either
011: * version 2 of the License, or (at your option) any later version.
012: *
013: * Jacareto is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
016: * General Public License for more details.
017: *
018: * You should have received a copy of the GNU General Public
019: * License along with Jacareto; if not, write to the Free
020: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
021: *
022: */
023:
024: package jacareto.struct;
025:
026: import jacareto.parse.RecordTokenizer;
027: import jacareto.system.Environment;
028:
029: /**
030: * The user structure "task". It can include other structures. A structure element can parse a part
031: * of a record.
032: *
033: * @author <a href="mailto:cspannagel@web.de">Markus Bois</a>
034: * @version 1.0
035: */
036: public class Task extends InteractionModelStructureElement {
037: /**
038: * Creates a new "task" structure element.
039: *
040: * @param env the environment
041: * @param children the child structure elements
042: */
043: public Task(Environment env, StructureElement[] children) {
044: this (env, children, "", "");
045: }
046:
047: /**
048: * Creates a new "task" structure element.
049: *
050: * @param env the environment
051: * @param children the child structure elements
052: * @param name the name of the task
053: * @param id the id in the interaction-model
054: */
055: public Task(Environment env, StructureElement[] children,
056: String name, String id) {
057: super (env, children, name, id);
058: }
059:
060: /**
061: * Parses a record which is tokenized by the given record tokenizer.
062: *
063: * @param env DOCUMENT ME!
064: * @param recordTokenizer the record tokenizer
065: *
066: * @return a structure element, or <code>null</code> if this class cannot parse the record at
067: * the current position
068: */
069: public static StructureElement parse(Environment env,
070: RecordTokenizer recordTokenizer) {
071: return null;
072: }
073:
074: /**
075: * Returns the name of the element.
076: *
077: * @return the name
078: */
079: public String getElementName() {
080: return language.getString("Structures.Task.Name");
081: }
082:
083: /**
084: * Returns a description of the element.
085: *
086: * @return the description
087: */
088: public String getElementDescription() {
089: return language.getString("Structures.Task.Description");
090: }
091:
092: /**
093: * Returns a String which describes the content of the element shortly.
094: *
095: * @return a string with a short description of the element
096: */
097: public String toShortString() {
098: return getName() + " (" + getElementName() + ")";
099: }
100:
101: /**
102: * Clones the element.
103: *
104: * @return DOCUMENT ME!
105: */
106: public Object clone() {
107: StructureElement[] clonedChildren = getClonedChildren();
108:
109: return new Task(env, clonedChildren, getName(), getID());
110: }
111: }
|