Codota Logo
OWLRealUtils.isInteger
Code IndexAdd Codota to your IDE (free)

How to use
isInteger
method
in
openllet.core.datatypes.OWLRealUtils

Best Java code snippets using openllet.core.datatypes.OWLRealUtils.isInteger (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: Galigator/openllet

@Override
protected boolean valid(final Number n)
{
  if (n == null)
    return true;
  return OWLRealUtils.acceptable(n.getClass()) && OWLRealUtils.isInteger(n);
}
origin: Galigator/openllet

@Override
protected boolean valid(final Number n)
{
  if (n == null)
    return true;
  return OWLRealUtils.acceptable(n.getClass()) && OWLRealUtils.isInteger(n);
}
origin: Galigator/openllet

public AbstractDerivedIntegerType(final ATermAppl name, final Number lower, final Number upper)
{
  super(name);
  if (lower != null && !OWLRealUtils.isInteger(lower))
    throw new IllegalArgumentException();
  if (upper != null && !OWLRealUtils.isInteger(upper))
    throw new IllegalArgumentException();
  if (lower != null && upper != null && OWLRealUtils.compare(lower, upper) > 0)
    throw new IllegalArgumentException();
  final IntegerInterval i = new IntegerInterval(lower == null ? null : OWLRealUtils.getCanonicalObject(lower), upper == null ? null : OWLRealUtils.getCanonicalObject(upper));
  _dataRange = new RestrictedRealDatatype(this, i, null, null);
}
origin: Galigator/openllet

public AbstractDerivedIntegerType(final ATermAppl name, final Number lower, final Number upper)
{
  super(name);
  if (lower != null && !OWLRealUtils.isInteger(lower))
    throw new IllegalArgumentException();
  if (upper != null && !OWLRealUtils.isInteger(upper))
    throw new IllegalArgumentException();
  if (lower != null && upper != null && OWLRealUtils.compare(lower, upper) > 0)
    throw new IllegalArgumentException();
  final IntegerInterval i = new IntegerInterval(lower == null ? null : OWLRealUtils.getCanonicalObject(lower), upper == null ? null : OWLRealUtils.getCanonicalObject(upper));
  _dataRange = new RestrictedRealDatatype(this, i, null, null);
}
origin: Galigator/openllet

public static Number sum(final Number a, final Number b)
{
  if (isInteger(a) && isInteger(b))
    return integerSum(a, b);
  final Type ta = Type.get(a.getClass());
  final Type tb = Type.get(b.getClass());
  if (ta == null || tb == null)
  {
    final String msg = format("Unexpected number type %s,%s passed to integerSum method.", a.getClass().getCanonicalName(), b.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  if (EnumSet.of(ta, tb).contains(Type.RATIONAL))
  {
    final String msg = format("Addition for rational numbers is not supported");
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  final BigDecimal da = (BigDecimal) convertFromTo(a, ta, Type.BIG_DECIMAL);
  final BigDecimal db = (BigDecimal) convertFromTo(b, tb, Type.BIG_DECIMAL);
  return getCanonicalObject(da.add(db));
}
origin: Galigator/openllet

public static Number sum(final Number a, final Number b)
{
  if (isInteger(a) && isInteger(b))
    return integerSum(a, b);
  final Type ta = Type.get(a.getClass());
  final Type tb = Type.get(b.getClass());
  if (ta == null || tb == null)
  {
    final String msg = format("Unexpected number type %s,%s passed to integerSum method.", a.getClass().getCanonicalName(), b.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  if (EnumSet.of(ta, tb).contains(Type.RATIONAL))
  {
    final String msg = format("Addition for rational numbers is not supported");
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  final BigDecimal da = (BigDecimal) convertFromTo(a, ta, Type.BIG_DECIMAL);
  final BigDecimal db = (BigDecimal) convertFromTo(b, tb, Type.BIG_DECIMAL);
  return getCanonicalObject(da.add(db));
}
origin: Galigator/openllet

if (!intOk && OWLRealUtils.isInteger(next))
  next = null;
if (!decOk && OWLRealUtils.isDecimal(next))
origin: Galigator/openllet

if (!intOk && OWLRealUtils.isInteger(next))
  next = null;
if (!decOk && OWLRealUtils.isDecimal(next))
origin: Galigator/openllet

  @Test
  public void isDecimalValueInteger()
  {
    assertTrue(isInteger(new BigDecimal("0")));
    assertTrue(isInteger(new BigDecimal("1")));
    assertTrue(isInteger(new BigDecimal("10")));
    assertTrue(isInteger(new BigDecimal("11")));
    assertTrue(isInteger(new BigDecimal("0.0")));
    assertTrue(isInteger(new BigDecimal("1.0")));
    assertTrue(isInteger(new BigDecimal("1.00")));
    assertTrue(isInteger(new BigDecimal("10.0")));
    assertTrue(isInteger(new BigDecimal("11.0")));
    assertFalse(isInteger(new BigDecimal("10.01")));
  }
}
origin: Galigator/openllet

if (isInteger(n))
  return shrinkBigInteger(bigInteger(n));
else
origin: Galigator/openllet

@Deprecated
@Override
public int size()
{
  if (!_finite)
    throw new IllegalStateException();
  Number sum = 0;
  for (final IntegerInterval i : _intIntervals)
  {
    sum = OWLRealUtils.integerSum(sum, i.size());
    if (OWLRealUtils.compare(Integer.MAX_VALUE, sum) <= 0)
      return Integer.MAX_VALUE;
  }
  for (final ContinuousRealInterval i : _decimalIntervals)
    if (!OWLRealUtils.isInteger(i.getLower()))
    {
      sum = OWLRealUtils.integerIncrement(sum);
      if (OWLRealUtils.compare(Integer.MAX_VALUE, sum) <= 0)
        return Integer.MAX_VALUE;
    }
  for (final ContinuousRealInterval i : _rationalIntervals)
    if (!OWLRealUtils.isInteger(i.getLower()) && !OWLRealUtils.isRational(i.getLower()))
    {
      sum = OWLRealUtils.integerIncrement(sum);
      if (OWLRealUtils.compare(Integer.MAX_VALUE, sum) <= 0)
        return Integer.MAX_VALUE;
    }
  return sum.intValue();
}
origin: Galigator/openllet

@Deprecated
@Override
public int size()
{
  if (!_finite)
    throw new IllegalStateException();
  Number sum = 0;
  for (final IntegerInterval i : _intIntervals)
  {
    sum = OWLRealUtils.integerSum(sum, i.size());
    if (OWLRealUtils.compare(Integer.MAX_VALUE, sum) <= 0)
      return Integer.MAX_VALUE;
  }
  for (final ContinuousRealInterval i : _decimalIntervals)
    if (!OWLRealUtils.isInteger(i.getLower()))
    {
      sum = OWLRealUtils.integerIncrement(sum);
      if (OWLRealUtils.compare(Integer.MAX_VALUE, sum) <= 0)
        return Integer.MAX_VALUE;
    }
  for (final ContinuousRealInterval i : _rationalIntervals)
    if (!OWLRealUtils.isInteger(i.getLower()) && !OWLRealUtils.isRational(i.getLower()))
    {
      sum = OWLRealUtils.integerIncrement(sum);
      if (OWLRealUtils.compare(Integer.MAX_VALUE, sum) <= 0)
        return Integer.MAX_VALUE;
    }
  return sum.intValue();
}
origin: Galigator/openllet

if (OWLRealUtils.isInteger(n))
origin: Galigator/openllet

if (OWLRealUtils.isInteger(n))
origin: Galigator/openllet

public boolean contains(final Number n)
{
  if (_type.equals(LineType.INTEGER_ONLY))
  {
    if (!isInteger(n))
      return false;
  }
  else
    if (_type.equals(LineType.INTEGER_EXCLUDED))
      if (isInteger(n))
        return false;
  int comp;
  if (boundLower())
  {
    comp = OWLRealUtils.compare(getLower(), n);
    if (comp > 0)
      return false;
    if (comp == 0 && !inclusiveLower())
      return false;
  }
  if (boundUpper())
  {
    comp = OWLRealUtils.compare(getUpper(), n);
    if (comp < 0)
      return false;
    if (comp == 0 && !inclusiveUpper())
      return false;
  }
  return true;
}
origin: Galigator/openllet

public boolean contains(final Number n)
{
  if (_type.equals(LineType.INTEGER_ONLY))
  {
    if (!isInteger(n))
      return false;
  }
  else
    if (_type.equals(LineType.INTEGER_EXCLUDED))
      if (isInteger(n))
        return false;
  int comp;
  if (boundLower())
  {
    comp = OWLRealUtils.compare(getLower(), n);
    if (comp > 0)
      return false;
    if (comp == 0 && !inclusiveLower())
      return false;
  }
  if (boundUpper())
  {
    comp = OWLRealUtils.compare(getUpper(), n);
    if (comp < 0)
      return false;
    if (comp == 0 && !inclusiveUpper())
      return false;
  }
  return true;
}
origin: Galigator/openllet

@Override
public boolean containsAtLeast(final int n)
{
  if (!_finite || n <= 0)
    return true;
  Number sum = 0;
  for (final IntegerInterval i : _intIntervals)
  {
    sum = OWLRealUtils.integerSum(sum, i.size());
    if (OWLRealUtils.compare(n, sum) <= 0)
      return true;
  }
  for (final ContinuousRealInterval i : _decimalIntervals)
    if (!OWLRealUtils.isInteger(i.getLower()))
    {
      sum = OWLRealUtils.integerIncrement(sum);
      if (OWLRealUtils.compare(n, sum) <= 0)
        return true;
    }
  for (final ContinuousRealInterval i : _rationalIntervals)
    if (!OWLRealUtils.isInteger(i.getLower()) && !OWLRealUtils.isRational(i.getLower()))
    {
      sum = OWLRealUtils.integerIncrement(sum);
      if (OWLRealUtils.compare(n, sum) <= 0)
        return true;
    }
  return false;
}
origin: Galigator/openllet

@Override
public boolean containsAtLeast(final int n)
{
  if (!_finite || n <= 0)
    return true;
  Number sum = 0;
  for (final IntegerInterval i : _intIntervals)
  {
    sum = OWLRealUtils.integerSum(sum, i.size());
    if (OWLRealUtils.compare(n, sum) <= 0)
      return true;
  }
  for (final ContinuousRealInterval i : _decimalIntervals)
    if (!OWLRealUtils.isInteger(i.getLower()))
    {
      sum = OWLRealUtils.integerIncrement(sum);
      if (OWLRealUtils.compare(n, sum) <= 0)
        return true;
    }
  for (final ContinuousRealInterval i : _rationalIntervals)
    if (!OWLRealUtils.isInteger(i.getLower()) && !OWLRealUtils.isRational(i.getLower()))
    {
      sum = OWLRealUtils.integerIncrement(sum);
      if (OWLRealUtils.compare(n, sum) <= 0)
        return true;
    }
  return false;
}
origin: Galigator/openllet

if (OWLRealUtils.isInteger(cl))
if (OWLRealUtils.isInteger(cu))
origin: Galigator/openllet

if (OWLRealUtils.isInteger(cl))
if (OWLRealUtils.isInteger(cu))
openllet.core.datatypesOWLRealUtilsisInteger

Popular methods of OWLRealUtils

  • compare
  • getCanonicalObject
  • acceptable
  • bigDecimal
  • bigInteger
  • convertFromTo
  • integerDecrement
  • integerDifference
  • integerIncrement
  • integerSum
  • isDecimal
  • isRational
  • isDecimal,
  • isRational,
  • print,
  • roundCeiling,
  • roundDown,
  • roundFloor,
  • shrinkBigInteger,
  • signum,
  • sum

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now