in progress
[jalview.git] / forester / java / src / org / forester / surfacing / DirectedCombinableDomains.java
1 // $Id:
2 //
3 // FORESTER -- software libraries and applications
4 // for evolutionary biology research and applications.
5 //
6 // Copyright (C) 2008-2009 Christian M. Zmasek
7 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
8 // All rights reserved
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 //
24 // Contact: phylosoft @ gmail . com
25 // WWW: https://sites.google.com/site/cmzmasek/home/software/forester
26
27 package org.forester.surfacing;
28
29 import java.util.ArrayList;
30 import java.util.List;
31
32 import org.forester.protein.BinaryDomainCombination;
33 import org.forester.species.Species;
34
35 public class DirectedCombinableDomains extends BasicCombinableDomains {
36
37     public DirectedCombinableDomains( final String n_terminal_key_domain, final Species species ) {
38         super( n_terminal_key_domain, species );
39     }
40
41     @Override
42     public List<BinaryDomainCombination> toBinaryDomainCombinations() {
43         final List<BinaryDomainCombination> binary_combinations = new ArrayList<BinaryDomainCombination>( getNumberOfCombinableDomains() );
44         for( final String domain : getCombiningDomains().keySet() ) {
45             // Precondition (!): key domain is most upstream domain.
46             //TODO ensure this is true.
47             binary_combinations.add( DirectedBinaryDomainCombination.obtainInstance( getKeyDomain(), domain ) );
48         }
49         return binary_combinations;
50     }
51 }