Ignore:
Timestamp:
09/05/14 19:33:12 (10 years ago)
Author:
rkrimmel
Message:

Used Eclipse code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/StructuringTemporalRelationship.java

    r1357 r1733  
    2323/** 
    2424 * <p> 
    25  * this is the default implementation of the interface {@link IStructuringTemporalRelationship}. It 
    26  * does not do anything fancy except implementing the interface. 
     25 * this is the default implementation of the interface 
     26 * {@link IStructuringTemporalRelationship}. It does not do anything fancy 
     27 * except implementing the interface. 
    2728 * </p> 
    2829 *  
    2930 * @author Patrick Harms 
    3031 */ 
    31 abstract class StructuringTemporalRelationship extends Task 
    32     implements IStructuringTemporalRelationship 
    33 { 
     32abstract class StructuringTemporalRelationship extends Task implements 
     33                IStructuringTemporalRelationship { 
    3434 
    35     /** 
    36      * <p> 
    37      * default serial version UID 
    38      * </p> 
    39      */ 
    40     private static final long serialVersionUID = 1L; 
    41      
    42     /** 
    43      * <p> 
    44      * the list of children of this temporal relationship 
    45      * </p> 
    46      */ 
    47     private List<ITask> children = new LinkedList<ITask>(); 
     35        /** 
     36         * <p> 
     37         * default serial version UID 
     38         * </p> 
     39         */ 
     40        private static final long serialVersionUID = 1L; 
    4841 
    49     /** 
    50      * <p> 
    51      * initializes this temporal relationship with a human readable name 
    52      * </p> 
    53      * 
    54      * @param relationshipType the human readable name of this temporal relationship 
    55      */ 
    56     StructuringTemporalRelationship(String relationshipType) { 
    57         super(relationshipType); 
    58          
    59         if ((relationshipType == null) || ("".equals(relationshipType))) { 
    60             throw new IllegalArgumentException 
    61                 ("the relationship type must be something meaningful"); 
    62         } 
    63     } 
     42        /** 
     43         * <p> 
     44         * the list of children of this temporal relationship 
     45         * </p> 
     46         */ 
     47        private List<ITask> children = new LinkedList<ITask>(); 
    6448 
    65     /* (non-Javadoc) 
    66      * @see de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship#getChildren() 
    67      */ 
    68     @Override 
    69     public List<ITask> getChildren() { 
    70         return children; 
    71     } 
     49        /** 
     50         * <p> 
     51         * initializes this temporal relationship with a human readable name 
     52         * </p> 
     53         * 
     54         * @param relationshipType 
     55         *            the human readable name of this temporal relationship 
     56         */ 
     57        StructuringTemporalRelationship(String relationshipType) { 
     58                super(relationshipType); 
    7259 
    73     /* (non-Javadoc) 
    74      * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.Task#clone() 
    75      */ 
    76     @Override 
    77     public synchronized StructuringTemporalRelationship clone() { 
    78         StructuringTemporalRelationship clone = null; 
    79         clone = (StructuringTemporalRelationship) super.clone(); 
    80              
    81         clone.children = new LinkedList<ITask>(); 
    82          
    83         for (ITask child : this.children) { 
    84             clone.children.add(child.clone()); 
    85         } 
     60                if ((relationshipType == null) || ("".equals(relationshipType))) { 
     61                        throw new IllegalArgumentException( 
     62                                        "the relationship type must be something meaningful"); 
     63                } 
     64        } 
    8665 
    87         return clone; 
    88     } 
     66        /** 
     67         * <p> 
     68         * used to add a new child to this temporal relationship at a specific 
     69         * position. 
     70         * </p> 
     71         * 
     72         * @param index 
     73         *            the index of the new child to be added. 
     74         * @param newChild 
     75         *            the new child to be added 
     76         */ 
     77        void addChild(int index, ITask newChild) { 
     78                children.add(index, newChild); 
     79        } 
    8980 
    90     /** 
    91      * <p> 
    92      * used to add a new child to this temporal relationship. 
    93      * </p> 
    94      * 
    95      * @param newChild the new child to be added 
    96      */ 
    97     void addChild(ITask newChild) { 
    98         children.add(newChild); 
    99     } 
     81        /** 
     82         * <p> 
     83         * used to add a new child to this temporal relationship. 
     84         * </p> 
     85         * 
     86         * @param newChild 
     87         *            the new child to be added 
     88         */ 
     89        void addChild(ITask newChild) { 
     90                children.add(newChild); 
     91        } 
    10092 
    101     /** 
    102      * <p> 
    103      * used to add a new child to this temporal relationship at a specific position. 
    104      * </p> 
    105      * 
    106      * @param index    the index of the new child to be added. 
    107      * @param newChild the new child to be added 
    108      */ 
    109     void addChild(int index, ITask newChild) { 
    110         children.add(index, newChild); 
    111     } 
    112      
    113     /** 
    114      * <p> 
    115      * removes a child from this temporal relationship at a specific position. 
    116      * </p> 
    117      * 
    118      * @param index the index of the child to be removed. 
    119      */ 
    120     void removeChild(int index) { 
    121         children.remove(index); 
    122     } 
     93        /* 
     94         * (non-Javadoc) 
     95         *  
     96         * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.Task#clone() 
     97         */ 
     98        @Override 
     99        public synchronized StructuringTemporalRelationship clone() { 
     100                StructuringTemporalRelationship clone = null; 
     101                clone = (StructuringTemporalRelationship) super.clone(); 
     102 
     103                clone.children = new LinkedList<ITask>(); 
     104 
     105                for (final ITask child : this.children) { 
     106                        clone.children.add(child.clone()); 
     107                } 
     108 
     109                return clone; 
     110        } 
     111 
     112        /* 
     113         * (non-Javadoc) 
     114         *  
     115         * @see 
     116         * de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship 
     117         * #getChildren() 
     118         */ 
     119        @Override 
     120        public List<ITask> getChildren() { 
     121                return children; 
     122        } 
     123 
     124        /** 
     125         * <p> 
     126         * removes a child from this temporal relationship at a specific position. 
     127         * </p> 
     128         * 
     129         * @param index 
     130         *            the index of the child to be removed. 
     131         */ 
     132        void removeChild(int index) { 
     133                children.remove(index); 
     134        } 
    123135} 
Note: See TracChangeset for help on using the changeset viewer.