if ( ( n_terminal == null ) || ( c_terminal == null ) ) {
throw new IllegalArgumentException( "attempt to create binary domain combination using null" );
}
- _id0 = n_terminal;
- _id1 = c_terminal;
+ // _id0 = n_terminal;
+ // _id1 = c_terminal;
+ _data = n_terminal + SEPARATOR + c_terminal;
}
public static AdjactantDirectedBinaryDomainCombination createInstance( final String ids ) {
public class BasicBinaryDomainCombination implements BinaryDomainCombination {
- String _id0;
- String _id1;
- String _str;
+ // String _id0;
+ // String _id1;
+ String _data;
public BasicBinaryDomainCombination( final String id0, final String id1 ) {
if ( ( id0 == null ) || ( id1 == null ) ) {
throw new IllegalArgumentException( "attempt to create binary domain combination using null" );
}
if ( id0.toLowerCase().compareTo( id1.toLowerCase() ) < 0 ) {
- _id0 = id0;
- _id1 = id1;
+ // _id0 = id0;
+ // _id1 = id1;
+ _data = id0 + SEPARATOR + id1;
}
else {
- _id0 = id1;
- _id1 = id0;
+ // _id0 = id1;
+ // _id1 = id0;
+ _data = id1 + SEPARATOR + id0;
}
}
BasicBinaryDomainCombination() {
- _id0 = null;
- _id1 = null;
+ //_id0 = null;
+ // _id1 = null;
+ _data = null;
}
@Override
@Override
public String getId0() {
- return _id0;
+ return _data.substring( 0, _data.indexOf( SEPARATOR ) );
+ // return _id0;
}
@Override
public String getId1() {
- return _id1;
+ return _data.substring( _data.indexOf( SEPARATOR ) + 1 );
+ //return _id1;
}
@Override
}
private String getAsStr() {
- return _id0 + SEPARATOR + _id1;
+ // return _id0 + SEPARATOR + _id1;
+ return _data;
}
public static BinaryDomainCombination createInstance( final String ids ) {
if ( ( n_terminal == null ) || ( c_terminal == null ) ) {
throw new IllegalArgumentException( "attempt to create binary domain combination using null" );
}
- _id0 = n_terminal;
- _id1 = c_terminal;
+ //_id0 = n_terminal;
+ //_id1 = c_terminal;
+ _data = n_terminal + SEPARATOR + c_terminal;
}
public static BinaryDomainCombination createInstance( final String ids ) {
@SuppressWarnings( "unused")
public final class Test {
- private final static boolean PERFORM_DB_TESTS = true;
+ private final static boolean PERFORM_DB_TESTS = false;
private final static double ZERO_DIFF = 1.0E-9;
private final static String PATH_TO_TEST_DATA = System.getProperty( "user.dir" )
+ ForesterUtil.getFileSeparator() + "test_data"