Codota Logo
Rational.<init>
Code IndexAdd Codota to your IDE (free)

How to use
it.tidalwave.image.Rational
constructor

Best Java code snippets using it.tidalwave.image.Rational.<init> (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: it.tidalwave.image/image-core

/*******************************************************************************************************************
 *
 *
 *
 ******************************************************************************************************************/
@Nonnull
public final Rational getReciprocal()
 {
  return new Rational(denominator, numerator);
 }
origin: it.tidalwave.image/image-core

/*******************************************************************************************************************
 *
 *
 * @param det
 * @return
 *
 ******************************************************************************************************************/
@Nonnull
public final Rational divide (final double det)
 {
  return new Rational(numerator, (int)Math.round(denominator * det));
 }
origin: it.tidalwave.metadata/it-tidalwave-metadata-viewer

 @Override
 @Nonnull
 public Rational convertReverse (@Nonnull final String string)
  {
   final String[] split = string.split("/");
   // FIXME: requires a dependency on Metadata-Extractor because there's a Rational constructor using it.
   // Drop it!
   if (split.length == 1)
    {
     return new Rational(Integer.valueOf(split[0].trim()), 1);  
    }
   
   return new Rational(Integer.valueOf(split[0].trim()), Integer.valueOf(split[1].trim()));  
  }
}
origin: it.tidalwave.image/image-core

 /***************************************************************************
  *
  *
  **************************************************************************/
 private static Rational[] convertRationalArray (final TagRational[] temp)
  {
   final Rational[] r = new Rational[temp.length];
   for (int i = 0; i < r.length; i++)
    {
     r[i] = new Rational(temp[i].getNumerator(), temp[i].getDenominator());
    }
   return r;
  }
}
origin: it.tidalwave.image/image-core

 /***************************************************************************
  *
  *
  **************************************************************************/
 private static Rational[] convertRationalArray (final com.drew.lang.Rational[] temp)
  {
   final Rational[] r = new Rational[temp.length];
   for (int i = 0; i < r.length; i++)
    {
     r[i] = new Rational((int)temp[i].getNumerator(), (int)temp[i].getDenominator());
    }
   return r;
  }
}
origin: it.tidalwave.image/image-core

value = new Rational((int)array[0][0], (int)array[0][1]);
origin: it.tidalwave.image/image-core

/***************************************************************************
 *
 *
 **************************************************************************/
@Override
public Object getObject (final int tag)
 throws NoSuchElementException
 {
  checkIfTagExists(tag);
  final Object value = directory.getObject(Integer.valueOf(tag));
  if (value instanceof TagRational)
   {
    final TagRational rational = (TagRational)value;
    return new Rational(rational.getNumerator(), rational.getDenominator());
   }
  else if (value instanceof TagRational[])
   {
    return convertRationalArray((TagRational[])value);
   }
  return value;
 }
origin: it.tidalwave.image/image-core

/***************************************************************************
 *
 *
 **************************************************************************/
@Override
public Object getObject (final int tag)
  throws NoSuchElementException
 {
  checkIfTagExists(tag);
  Object value = directory.getObject(tag);
  if (value instanceof com.drew.lang.Rational)
   {
    final com.drew.lang.Rational drewRational = (com.drew.lang.Rational) value;
    value = new Rational((int)drewRational.getNumerator(), (int)drewRational.getDenominator());
   }
  else if (value instanceof com.drew.lang.Rational[])
   {
    value = convertRationalArray((com.drew.lang.Rational[])value);
   }
  return value;
 }
it.tidalwave.imageRational<init>

Popular methods of Rational

  • doubleValue
  • toString

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • setContentView (Activity)
  • findViewById (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • JLabel (javax.swing)
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