Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Willms
hfc
Commits
9f7863bf
Commit
9f7863bf
authored
Jul 11, 2018
by
Christian Willms
Browse files
Merge branch 'developer' of mlt-gitlab.sb.dfki.de:kiefer/hfc into developer
parents
6b92d82f
25e5e9ed
Changes
13
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
9f7863bf
...
...
@@ -7,7 +7,7 @@
<groupId>
de.dfki.lt.hfc
</groupId>
<artifactId>
hfc
</artifactId>
<version>
1.2.
2
-SNAPSHOT
</version>
<version>
1.2.
3
-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<inceptionYear>
2015
</inceptionYear>
...
...
src/main/java/de/dfki/lt/hfc/operators/Equal.java
0 → 100644
View file @
9f7863bf
package
de.dfki.lt.hfc.operators
;
import
de.dfki.lt.hfc.FunctionalOperator
;
/**
* checks whether the first argument is equal to the second argument;
* arguments are assumed to be numbers of type xsd:int
*
* @return FunctionalOperator.TRUE or FunctionalOperator.FALSE
*
* @see FunctionalOperator
*
* @author (C) Hans-Ulrich Krieger
* @since JDK 1.5
* @version Wed Jun 23 11:04:27 CEST 2010
*/
public
final
class
Equal
extends
FunctionalOperator
{
/**
* note that apply() does NOT check at the moment whether the int args
* represent in fact XSD ints;
* note that apply() does NOT check whether it is given exactly two arguments
*/
public
int
apply
(
int
[]
args
)
{
return
getObject
(
args
[
0
]).
compareTo
(
getObject
(
args
[
1
]))
==
0
?
FunctionalOperator
.
TRUE
:
FunctionalOperator
.
FALSE
;
}
}
src/main/java/de/dfki/lt/hfc/operators/Greater.java
0 → 100644
View file @
9f7863bf
package
de.dfki.lt.hfc.operators
;
import
de.dfki.lt.hfc.FunctionalOperator
;
/**
* checks whether the first argument is greater than the second argument;
* arguments are assumed to be xsd:longs;
* @return FunctionalOperator.TRUE or FunctionalOperator.FALSE
*
* @see FunctionalOperator
*
* @author (C) Hans-Ulrich Krieger
* @since JDK 1.5
* @version Tue Sep 29 11:11:19 CEST 2009
*/
public
final
class
Greater
extends
FunctionalOperator
{
/**
* note that apply() does NOT check at the moment whether the int args
* represent in fact XSD longs;
* note that apply() does NOT check whether it is given exactly two arguments
*/
public
int
apply
(
int
[]
args
)
{
return
getObject
(
args
[
0
]).
compareTo
(
getObject
(
args
[
1
]))
>
0
?
FunctionalOperator
.
TRUE
:
FunctionalOperator
.
FALSE
;
}
}
src/main/java/de/dfki/lt/hfc/operators/GreaterEqual.java
0 → 100644
View file @
9f7863bf
package
de.dfki.lt.hfc.operators
;
import
de.dfki.lt.hfc.FunctionalOperator
;
/**
* checks whether the first argument is greater or equal than the second argument;
* arguments are assumed to be xsd:floats;
* @return FunctionalOperator.TRUE or FunctionalOperator.FALSE
*
* @see FunctionalOperator
*
* @author (C) Hans-Ulrich Krieger
* @since JDK 1.5
* @version Tue Sep 29 11:11:19 CEST 2009
*/
public
final
class
GreaterEqual
extends
FunctionalOperator
{
/**
* note that apply() does NOT check at the moment whether the int args
* represent in fact XSD floats;
* note that apply() does NOT check whether it is given exactly two arguments
*/
public
int
apply
(
int
[]
args
)
{
return
getObject
(
args
[
0
]).
compareTo
(
getObject
(
args
[
1
]))
>=
0
?
FunctionalOperator
.
TRUE
:
FunctionalOperator
.
FALSE
;
}
}
src/main/java/de/dfki/lt/hfc/operators/Less.java
0 → 100644
View file @
9f7863bf
package
de.dfki.lt.hfc.operators
;
import
de.dfki.lt.hfc.FunctionalOperator
;
/**
* checks whether the first argument is less than the second argument;
* arguments are assumed to be xsd:floats;
* @return FunctionalOperator.TRUE or FunctionalOperator.FALSE
*
* @see FunctionalOperator
*
* @author (C) Hans-Ulrich Krieger
* @since JDK 1.5
* @version Tue Sep 29 11:11:19 CEST 2009
*/
public
final
class
Less
extends
FunctionalOperator
{
/**
* note that apply() does NOT check at the moment whether the int args
* represent in fact XSD floats;
* note that apply() does NOT check whether it is given exactly two arguments
*/
public
int
apply
(
int
[]
args
)
{
return
getObject
(
args
[
0
]).
compareTo
(
getObject
(
args
[
1
]))
<
0
?
FunctionalOperator
.
TRUE
:
FunctionalOperator
.
FALSE
;
}
}
src/main/java/de/dfki/lt/hfc/operators/LessEqual.java
0 → 100644
View file @
9f7863bf
package
de.dfki.lt.hfc.operators
;
import
de.dfki.lt.hfc.FunctionalOperator
;
/**
* checks whether the first argument is less or equal than the second argument;
* arguments are assumed to be xsd:ints;
* @return FunctionalOperator.TRUE or FunctionalOperator.FALSE
*
* @see FunctionalOperator
*
* @author (C) Hans-Ulrich Krieger
* @since JDK 1.5
* @version Tue Sep 29 11:11:19 CEST 2009
*/
public
final
class
LessEqual
extends
FunctionalOperator
{
/**
* note that apply() does NOT check at the moment whether the int args
* represent in fact XSD ints;
* note that apply() does NOT check whether it is given exactly two arguments
*/
public
int
apply
(
int
[]
args
)
{
return
getObject
(
args
[
0
]).
compareTo
(
getObject
(
args
[
1
]))
<=
0
?
FunctionalOperator
.
TRUE
:
FunctionalOperator
.
FALSE
;
}
}
src/main/java/de/dfki/lt/hfc/types/XsdDecimal.java
View file @
9f7863bf
...
...
@@ -5,7 +5,7 @@ package de.dfki.lt.hfc.types;
* @author Christian Willms - Date: 28.11.17 17:11.
* @version 28.11.17
*/
public
class
XsdDecimal
extends
Xsd
AnySimpleType
{
public
class
XsdDecimal
extends
Xsd
Number
{
public
final
static
String
NAME
=
"decimal"
;
...
...
@@ -73,10 +73,11 @@ public class XsdDecimal extends XsdAnySimpleType{
AnyType
.
MinMaxValue
minMaxValue
=
(
MinMaxValue
)
o
;
return
minMaxValue
.
compareTo
(
this
);
}
if
(!
(
o
instanceof
XsdDecimal
)){
throw
new
IllegalArgumentException
(
"Can't compare "
+
this
.
getClass
()+
" and "
+
o
.
getClass
()
);
}
return
Double
.
compare
(
this
.
value
,((
XsdDecimal
)
o
).
value
);
if
(
o
instanceof
XsdDecimal
)
return
Double
.
compare
(
this
.
value
,((
XsdDecimal
)
o
).
value
);
else
if
(
o
instanceof
XsdNumber
)
return
Double
.
compare
(
this
.
value
,
((
XsdNumber
)
o
).
toNumber
().
doubleValue
());
throw
new
IllegalArgumentException
(
"Can't compare "
+
this
.
getClass
()+
" and "
+
o
.
getClass
()
);
}
}
src/main/java/de/dfki/lt/hfc/types/XsdDouble.java
View file @
9f7863bf
...
...
@@ -8,7 +8,7 @@ package de.dfki.lt.hfc.types;
* @since JDK 1.5
* @version Fri Jan 29 19:28:31 CET 2016
*/
public
final
class
XsdDouble
extends
Xsd
AnySimpleType
{
public
final
class
XsdDouble
extends
Xsd
Number
{
public
final
static
String
NAME
=
"double"
;
...
...
@@ -85,10 +85,11 @@ public final class XsdDouble extends XsdAnySimpleType {
AnyType
.
MinMaxValue
minMaxValue
=
(
MinMaxValue
)
o
;
return
minMaxValue
.
compareTo
(
this
);
}
if
(!
(
o
instanceof
XsdDouble
)){
throw
new
IllegalArgumentException
(
"Can't compare "
+
this
.
getClass
()+
" and "
+
o
.
getClass
()
);
}
return
Double
.
compare
(
this
.
value
,((
XsdDouble
)
o
).
value
);
if
(
o
instanceof
XsdDouble
)
return
Double
.
compare
(
this
.
value
,((
XsdDouble
)
o
).
value
);
else
if
(
o
instanceof
XsdNumber
)
return
Double
.
compare
(
this
.
value
,
((
XsdNumber
)
o
).
toNumber
().
doubleValue
());
throw
new
IllegalArgumentException
(
"Can't compare "
+
this
.
getClass
()+
" and "
+
o
.
getClass
()
);
}
}
src/main/java/de/dfki/lt/hfc/types/XsdFloat.java
View file @
9f7863bf
...
...
@@ -6,7 +6,7 @@ package de.dfki.lt.hfc.types;
* @since JDK 1.5
* @version Fri Jan 29 19:29:19 CET 2016
*/
public
final
class
XsdFloat
extends
Xsd
AnySimpleType
{
public
final
class
XsdFloat
extends
Xsd
Number
{
public
final
static
String
NAME
=
"float"
;
public
final
static
String
SHORT_NAME
=
'<'
+
SHORT_PREFIX
+
NAME
+
'>'
;
...
...
@@ -87,10 +87,11 @@ public final class XsdFloat extends XsdAnySimpleType {
AnyType
.
MinMaxValue
minMaxValue
=
(
MinMaxValue
)
o
;
return
minMaxValue
.
compareTo
(
this
);
}
if
(!
(
o
instanceof
XsdFloat
)){
throw
new
IllegalArgumentException
(
"Can't compare "
+
this
.
getClass
()+
" and "
+
o
.
getClass
()
);
}
return
Float
.
compare
(
this
.
value
,((
XsdFloat
)
o
).
value
);
if
(
o
instanceof
XsdFloat
)
return
Float
.
compare
(
this
.
value
,((
XsdFloat
)
o
).
value
);
else
if
(
o
instanceof
XsdNumber
)
return
Float
.
compare
(
this
.
value
,
((
XsdNumber
)
o
).
toNumber
().
floatValue
());
throw
new
IllegalArgumentException
(
"Can't compare "
+
this
.
getClass
()+
" and "
+
o
.
getClass
()
);
}
}
src/main/java/de/dfki/lt/hfc/types/XsdInt.java
View file @
9f7863bf
...
...
@@ -5,7 +5,7 @@ package de.dfki.lt.hfc.types;
* @since JDK 1.5
* @version Fri Jan 29 19:30:23 CET 2016
*/
public
final
class
XsdInt
extends
Xsd
AnySimpleType
{
public
final
class
XsdInt
extends
Xsd
Number
{
public
final
static
String
NAME
=
"int"
;
public
final
static
String
SHORT_NAME
=
'<'
+
SHORT_PREFIX
+
NAME
+
'>'
;
...
...
@@ -86,10 +86,11 @@ public final class XsdInt extends XsdAnySimpleType {
AnyType
.
MinMaxValue
minMaxValue
=
(
MinMaxValue
)
o
;
return
minMaxValue
.
compareTo
(
this
);
}
if
(!
(
o
instanceof
XsdInt
)){
throw
new
IllegalArgumentException
(
"Can't compare "
+
this
.
getClass
()+
" and "
+
o
.
getClass
()
);
}
return
Integer
.
compare
(
this
.
value
,((
XsdInt
)
o
).
value
);
if
(
o
instanceof
XsdInt
)
return
Integer
.
compare
(
this
.
value
,((
XsdInt
)
o
).
value
);
else
if
(
o
instanceof
XsdNumber
)
return
Integer
.
compare
(
this
.
value
,
((
XsdNumber
)
o
).
toNumber
().
intValue
());
throw
new
IllegalArgumentException
(
"Can't compare "
+
this
.
getClass
()+
" and "
+
o
.
getClass
()
);
}
}
src/main/java/de/dfki/lt/hfc/types/XsdLong.java
View file @
9f7863bf
...
...
@@ -9,7 +9,7 @@ package de.dfki.lt.hfc.types;
* @since JDK 1.5
* @version Fri Jan 29 19:32:15 CET 2016
*/
public
final
class
XsdLong
extends
Xsd
AnySimpleType
{
public
final
class
XsdLong
extends
Xsd
Number
{
public
final
static
String
NAME
=
"long"
;
public
final
static
String
SHORT_NAME
=
'<'
+
SHORT_PREFIX
+
NAME
+
'>'
;
...
...
@@ -91,10 +91,10 @@ public final class XsdLong extends XsdAnySimpleType {
AnyType
.
MinMaxValue
minMaxValue
=
(
MinMaxValue
)
o
;
return
minMaxValue
.
compareTo
(
this
);
}
i
nt
res
;
if
(!
(
o
instanceof
XsdLong
)){
throw
new
IllegalArgumentException
(
"Can't compare "
+
this
.
getClass
()+
" and "
+
o
.
getClass
()
);
}
return
Long
.
compare
(
this
.
value
,((
XsdLong
)
o
).
value
);
i
f
(
o
instanceof
XsdLong
)
return
Long
.
compare
(
this
.
value
,((
XsdLong
)
o
).
value
);
else
if
(
o
instanceof
XsdNumber
)
return
Long
.
compare
(
this
.
value
,
((
XsdNumber
)
o
).
toNumber
().
longValue
());
throw
new
IllegalArgumentException
(
"Can't compare "
+
this
.
getClass
()+
" and "
+
o
.
getClass
()
);
}
}
\ No newline at end of file
src/main/java/de/dfki/lt/hfc/types/XsdNumber.java
0 → 100644
View file @
9f7863bf
package
de.dfki.lt.hfc.types
;
/** An abstract generic class for numbers, to facilitate comparison, conversion,
* etc.
*/
public
abstract
class
XsdNumber
extends
XsdAnySimpleType
{
protected
Number
toNumber
()
{
return
(
Number
)
toJava
();
}
}
src/test/java/de/dfki/lt/hfc/LessTest.java
0 → 100644
View file @
9f7863bf
package
de.dfki.lt.hfc
;
import
static
de
.
dfki
.
lt
.
hfc
.
TestingUtils
.*;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
de.dfki.lt.hfc.*
;
import
de.dfki.lt.hfc.types.*
;
import
org.junit.Test
;
public
class
LessTest
{
@Test
public
void
testLess
()
throws
FileNotFoundException
,
IOException
,
WrongFormatException
{
// load Namespace
Namespace
namespace
=
new
Namespace
(
getTestResource
(
"default.ns"
),
false
);
// create TupleStore
TupleStore
store
=
new
TupleStore
(
false
,
true
,
true
,
2
,
5
,
4
,
2
,
namespace
,
getTestResource
(
"default.nt"
));
int
[]
args
=
new
int
[
5
];
// create FunctionalOperator
FunctionalOperator
fop
=
(
FunctionalOperator
)
store
.
operatorRegistry
.
checkAndRegister
(
"de.dfki.lt.hfc.operators.Less"
);
args
[
0
]
=
store
.
putObject
((
new
XsdDouble
(
3.1
).
toString
(
true
)));
args
[
1
]
=
store
.
putObject
((
new
XsdLong
(
7
l
)).
toString
(
true
));
args
[
2
]
=
store
.
putObject
((
new
XsdInt
(
6
)).
toString
(
true
));
args
[
3
]
=
store
.
putObject
((
new
XsdFloat
(
5.0f
)).
toString
(
true
));
args
[
4
]
=
store
.
putObject
((
new
XsdDecimal
(
4.0
)).
toString
(
true
));
// do operation
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
2
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
0
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
1
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
3
],
args
[
4
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
2
],
args
[
1
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
1
],
args
[
0
]}));
}
@Test
public
void
testLessEq
()
throws
FileNotFoundException
,
IOException
,
WrongFormatException
{
// load Namespace
Namespace
namespace
=
new
Namespace
(
getTestResource
(
"default.ns"
),
false
);
// create TupleStore
TupleStore
store
=
new
TupleStore
(
false
,
true
,
true
,
2
,
5
,
4
,
2
,
namespace
,
getTestResource
(
"default.nt"
));
int
[]
args
=
new
int
[
5
];
// create FunctionalOperator
FunctionalOperator
fop
=
(
FunctionalOperator
)
store
.
operatorRegistry
.
checkAndRegister
(
"de.dfki.lt.hfc.operators.LessEqual"
);
args
[
0
]
=
store
.
putObject
((
new
XsdDouble
(
3.1
).
toString
(
true
)));
args
[
1
]
=
store
.
putObject
((
new
XsdLong
(
7
l
)).
toString
(
true
));
args
[
2
]
=
store
.
putObject
((
new
XsdInt
(
6
)).
toString
(
true
));
args
[
3
]
=
store
.
putObject
((
new
XsdFloat
(
5.0f
)).
toString
(
true
));
args
[
4
]
=
store
.
putObject
((
new
XsdDecimal
(
4.0
)).
toString
(
true
));
// do operation
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
2
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
0
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
1
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
3
],
args
[
4
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
2
],
args
[
1
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
1
],
args
[
0
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
2
],
args
[
2
]}));
}
@Test
public
void
testGreater
()
throws
FileNotFoundException
,
IOException
,
WrongFormatException
{
// load Namespace
Namespace
namespace
=
new
Namespace
(
getTestResource
(
"default.ns"
),
false
);
// create TupleStore
TupleStore
store
=
new
TupleStore
(
false
,
true
,
true
,
2
,
5
,
4
,
2
,
namespace
,
getTestResource
(
"default.nt"
));
int
[]
args
=
new
int
[
5
];
// create FunctionalOperator
FunctionalOperator
fop
=
(
FunctionalOperator
)
store
.
operatorRegistry
.
checkAndRegister
(
"de.dfki.lt.hfc.operators.Greater"
);
args
[
0
]
=
store
.
putObject
((
new
XsdDouble
(
3.1
).
toString
(
true
)));
args
[
1
]
=
store
.
putObject
((
new
XsdLong
(
7
l
)).
toString
(
true
));
args
[
2
]
=
store
.
putObject
((
new
XsdInt
(
6
)).
toString
(
true
));
args
[
3
]
=
store
.
putObject
((
new
XsdFloat
(
5.0f
)).
toString
(
true
));
args
[
4
]
=
store
.
putObject
((
new
XsdDecimal
(
4.0
)).
toString
(
true
));
// do operation
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
2
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
0
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
1
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
3
],
args
[
4
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
2
],
args
[
1
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
1
],
args
[
0
]}));
}
@Test
public
void
testGreaterEq
()
throws
FileNotFoundException
,
IOException
,
WrongFormatException
{
// load Namespace
Namespace
namespace
=
new
Namespace
(
getTestResource
(
"default.ns"
),
false
);
// create TupleStore
TupleStore
store
=
new
TupleStore
(
false
,
true
,
true
,
2
,
5
,
4
,
2
,
namespace
,
getTestResource
(
"default.nt"
));
int
[]
args
=
new
int
[
5
];
// create FunctionalOperator
FunctionalOperator
fop
=
(
FunctionalOperator
)
store
.
operatorRegistry
.
checkAndRegister
(
"de.dfki.lt.hfc.operators.GreaterEqual"
);
args
[
0
]
=
store
.
putObject
((
new
XsdDouble
(
3.1
).
toString
(
true
)));
args
[
1
]
=
store
.
putObject
((
new
XsdLong
(
7
l
)).
toString
(
true
));
args
[
2
]
=
store
.
putObject
((
new
XsdInt
(
6
)).
toString
(
true
));
args
[
3
]
=
store
.
putObject
((
new
XsdFloat
(
5.0f
)).
toString
(
true
));
args
[
4
]
=
store
.
putObject
((
new
XsdDecimal
(
4.0
)).
toString
(
true
));
// do operation
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
2
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
0
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
1
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
3
],
args
[
4
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
2
],
args
[
1
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
1
],
args
[
0
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
2
],
args
[
2
]}));
}
@Test
public
void
testEqual
()
throws
FileNotFoundException
,
IOException
,
WrongFormatException
{
// load Namespace
Namespace
namespace
=
new
Namespace
(
getTestResource
(
"default.ns"
),
false
);
// create TupleStore
TupleStore
store
=
new
TupleStore
(
false
,
true
,
true
,
2
,
5
,
4
,
2
,
namespace
,
getTestResource
(
"default.nt"
));
int
[]
args
=
new
int
[
5
];
// create FunctionalOperator
FunctionalOperator
fop
=
(
FunctionalOperator
)
store
.
operatorRegistry
.
checkAndRegister
(
"de.dfki.lt.hfc.operators.GreaterEqual"
);
args
[
0
]
=
store
.
putObject
((
new
XsdDouble
(
3.1
).
toString
(
true
)));
args
[
1
]
=
store
.
putObject
((
new
XsdLong
(
7
l
)).
toString
(
true
));
args
[
2
]
=
store
.
putObject
((
new
XsdInt
(
6
)).
toString
(
true
));
args
[
3
]
=
store
.
putObject
((
new
XsdFloat
(
5.0f
)).
toString
(
true
));
args
[
4
]
=
store
.
putObject
((
new
XsdDecimal
(
4.0
)).
toString
(
true
));
// do operation
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
2
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
4
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
4
],
args
[
1
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
3
],
args
[
3
]}));
assertEquals
(
FunctionalOperator
.
FALSE
,
fop
.
apply
(
new
int
[]{
args
[
2
],
args
[
1
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
0
],
args
[
0
]}));
assertEquals
(
FunctionalOperator
.
TRUE
,
fop
.
apply
(
new
int
[]{
args
[
2
],
args
[
2
]}));
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment