Ignore:
Timestamp:
09/23/14 13:55:37 (10 years ago)
Author:
rkrimmel
Message:

Memory improvement and bugs

File:
1 edited

Legend:

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

    r1747 r1760  
    44package de.ugoe.cs.autoquest.tasktrees.alignment.algorithms; 
    55 
    6 import java.io.Serializable; 
    7 import java.util.ArrayList; 
    86import java.util.Iterator; 
    97import java.util.LinkedList; 
     
    1311 * The Class Match. 
    1412 */ 
    15 public class Match implements Cloneable,Comparable<Match>,Serializable { 
    16          
    17         /** The Constant serialVersionUID. */ 
    18         private static final long serialVersionUID = -3206992723755714741L; 
     13public class Match { 
    1914 
    2015        /** The matchseqs. */ 
    21         private final ArrayList<NumberSequence> matchseqs; 
     16        private final NumberSequence[] matchseqs; 
    2217 
    2318        /** The occurences. */ 
     
    2823         */ 
    2924        public Match() { 
    30                 matchseqs = new ArrayList<NumberSequence>(2); 
     25                matchseqs = new NumberSequence[2]; 
    3126                occurrences = new LinkedList<MatchOccurrence>(); 
    32                 matchseqs.add(null); 
    33                 matchseqs.add(null); 
    34         }               // TODO Auto-generated method stub 
     27                 
     28        }                
    3529 
    3630        /** 
    37          * Adds the occurence. 
     31         * Adds the occurrence. 
    3832         * 
    39          * @param occurence the occurence 
     33         * @param occurence the occurrence 
    4034         */ 
    4135        public void addOccurence(MatchOccurrence occurence) { 
     
    7468         */ 
    7569        public NumberSequence getFirstSequence() { 
    76                 return matchseqs.get(0); 
     70                return matchseqs[0]; 
    7771        } 
    7872 
     
    9286         */ 
    9387        public NumberSequence getSecondSequence() { 
    94                 return matchseqs.get(1); 
     88                return matchseqs[1]; 
    9589        } 
    9690 
     
    110104         */ 
    111105        public void setFirstSequence(NumberSequence seq) { 
    112                 matchseqs.set(0, seq); 
     106                matchseqs[0] = seq; 
    113107        } 
    114108 
     
    128122         */ 
    129123        public void setSecondSequence(NumberSequence seq) { 
    130                 matchseqs.set(1, seq); 
     124                matchseqs[1] = seq; 
    131125        } 
    132126 
     
    169163         * @throws CloneNotSupportedException the clone not supported exception 
    170164         */ 
     165        /* 
    171166        public Match cloneWithoutOccurrences()   { 
    172167                Match result = new Match(); 
     
    174169                result.setSecondSequence(this.getSecondSequence()); 
    175170                return result; 
    176         } 
     171        }*/ 
    177172         
    178          
    179          
     173 
    180174        /** 
    181175         * Size. 
     
    185179        public int size() { 
    186180                // Both sequences should be equally long 
    187                 return matchseqs.get(0).size(); 
     181                return matchseqs[0].size(); 
    188182        } 
    189  
    190         /* (non-Javadoc) 
    191          * @see java.lang.Comparable#compareTo(java.lang.Object) 
    192          */ 
    193         @Override 
    194         public int compareTo(Match arg0) { 
    195                  
    196                 return 0; 
    197         } 
    198  
    199183} 
Note: See TracChangeset for help on using the changeset viewer.