View Javadoc
1   package org.apache.maven.plugin.cxx.utils.svn;
2   
3   /*
4    * Copyright (C) 2011-2016, Neticoa SAS France - Tous droits réservés.
5    * Author(s) : Franck Bonin, Neticoa SAS France
6    *
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   *
11   *     http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   *
19   */
20  
21  import java.util.ArrayList;
22  import java.util.Collection;
23  
24  /**
25   * svn 
26   * 
27   */
28  public class SvnExternalsEntries
29  {
30      //private HashMap<String, ExternalEntry> fromOrigin = new HashMap<String, ExternalEntry>();
31      //private HashMap<String, ExternalEntry> fromTargetDir = new HashMap<String, ExternalEntry>();
32      private ArrayList<SvnExternalEntry> ordered = new ArrayList<SvnExternalEntry>();
33      
34      public void put( SvnExternalEntry ee )
35      {
36          /*if ( fromOrigin.containsKey( ee.origin ) )
37          {
38              ExternalEntry eeo = fromOrigin.get( ee.origin );
39              fromTargetDir.remove( eeo.targetDir );
40              ordered.remove( ee );
41          }
42          if ( fromTargetDir.containsKey( ee.targetDir ) )
43          {
44              ExternalEntry eetd = fromTargetDir.get( ee.targetDir );
45              fromOrigin.remove( eetd.origin );
46              ordered.remove( ee );
47          }*/
48          
49          //fromOrigin.put( ee.origin, ee );
50          //fromTargetDir.put( ee.targetDir, ee );
51          int place = ordered.indexOf( ee );
52          if ( place != -1 )
53          {
54              ordered.set( place, ee );
55          }
56          else
57          {
58              ordered.add( ee );
59          }
60      }
61      
62      public Collection<SvnExternalEntry> values()
63      {
64          return ordered;
65      }
66  }