Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kernel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
af3
kernel
Commits
6fa0ea5e
Commit
6fa0ea5e
authored
May 20, 2020
by
Alexander Diewald
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into 3994
parents
5d44813a
b9505765
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
5 deletions
+45
-5
org.fortiss.tooling.base/src/org/fortiss/tooling/base/utils/.ratings
....tooling.base/src/org/fortiss/tooling/base/utils/.ratings
+1
-1
org.fortiss.tooling.base/src/org/fortiss/tooling/base/utils/BaseMathUtils.java
...ase/src/org/fortiss/tooling/base/utils/BaseMathUtils.java
+44
-4
No files found.
org.fortiss.tooling.base/src/org/fortiss/tooling/base/utils/.ratings
View file @
6fa0ea5e
AngleUtils.java 462551eae71738ff51f92c9906bff9a21a375d2b GREEN
AnnotationUtils.java 197ceb5f39af6b96eb8f7025e3fe3b1b39c35d42 GREEN
BaseMathUtils.java
65f6c39b641cba3c984a38f42b1bbf7dbf3287a3
GREEN
BaseMathUtils.java
90712a1560f5b4cb9b7873a148303c970ded756d
GREEN
BaseModelElementUtils.java b8775b7a462efc168cf79a017aa3377a782d10f6 GREEN
DimensionUtils.java 0dc67f9de11a84e6e4c6e1eb627817dee91ff30a GREEN
EllipseLayoutUtils.java 5c3a0126fdca5d5b4fb441694747e1cb0f49cd9f GREEN
...
...
org.fortiss.tooling.base/src/org/fortiss/tooling/base/utils/BaseMathUtils.java
View file @
6fa0ea5e
...
...
@@ -194,16 +194,56 @@ public class BaseMathUtils {
}
/**
* Predicate whether the given Number is an integer of the types Byte, Short, Integer,
Long,
* BigInteger.
* Predicate whether the given Number is an integer of the types Byte, Short, Integer,
*
Long, or
BigInteger.
*
* @param value
* Number to test.
* @return boolean if the given Number is an integer number.
*/
public
static
boolean
isIntegerNumber
(
Number
value
)
{
return
(
value
instanceof
Byte
||
value
instanceof
Short
||
value
instanceof
Integer
||
value
instanceof
Long
||
value
instanceof
BigInteger
);
return
value
!=
null
&&
isIntegerNumber
(
value
.
getClass
());
}
/**
* Predicate whether the given Number type is an integer of the types Byte, Short, Integer,
* Long, or BigInteger.
*
* @param valueType
* Type of the number to test.
* @return boolean if the given Number is an integer number.
*/
public
static
boolean
isIntegerNumber
(
Class
<?>
valueType
)
{
return
Byte
.
class
.
isAssignableFrom
(
valueType
)
||
Short
.
class
.
isAssignableFrom
(
valueType
)
||
Integer
.
class
.
isAssignableFrom
(
valueType
)
||
Long
.
class
.
isAssignableFrom
(
valueType
)
||
BigInteger
.
class
.
isAssignableFrom
(
valueType
);
}
/**
* Predicate whether the given Number type is an integer of the types Float, Double, or
* BigInteger.
*
* @param value
* Number to test.
* @return boolean if the given number is an floating point number.
*/
public
static
boolean
isFloatNumber
(
Number
value
)
{
return
value
!=
null
&&
isFloatNumber
(
value
.
getClass
());
}
/**
* Predicate whether the given Number type is an integer of the types Float, Double, or
* BigInteger.
*
* @param valueType
* Type of the number to test.
* @return boolean if the given number type is an integer number.
*/
public
static
boolean
isFloatNumber
(
Class
<?>
valueType
)
{
return
Float
.
class
.
isAssignableFrom
(
valueType
)
||
Double
.
class
.
isAssignableFrom
(
valueType
)
||
BigDecimal
.
class
.
isAssignableFrom
(
valueType
);
}
/**
...
...
Write
Preview
Markdown
is supported
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