Package cern.colt.function

Examples of cern.colt.function.IntFunction


/**
* Constructs a function that returns <tt>Math.min(a,b)</tt>.
* <tt>a</tt> is a variable, <tt>b</tt> is fixed.
*/
public static IntFunction min(final int b) {
  return new IntFunction() {
    public final int apply(int a) { return (a <= b) ? a : b; }
  };
}
View Full Code Here


/**
* Constructs a function that returns <tt>a - b</tt>.
* <tt>a</tt> is a variable, <tt>b</tt> is fixed.
*/
public static IntFunction minus(final int b) {
  return new IntFunction() {
    public final int apply(int a) { return a - b; }
  };
}
View Full Code Here

/**
* Constructs a function that returns <tt>a % b</tt>.
* <tt>a</tt> is a variable, <tt>b</tt> is fixed.
*/
public static IntFunction mod(final int b) {
  return new IntFunction() {
    public final int apply(int a) { return a % b; }
  };
}
View Full Code Here

/**
* Constructs a function that returns <tt>a * b</tt>.
* <tt>a</tt> is a variable, <tt>b</tt> is fixed.
*/
public static IntFunction mult(final int b) {
  return new IntFunction() {
    public final int apply(int a) { return a * b; }
  };
}
View Full Code Here

/**
* Constructs a function that returns <tt>a | b</tt>.
* <tt>a</tt> is a variable, <tt>b</tt> is fixed.
*/
public static IntFunction or(final int b) {
  return new IntFunction() {
    public final int apply(int a) { return a | b; }
  };
}
View Full Code Here

/**
* Constructs a function that returns <tt>a + b</tt>.
* <tt>a</tt> is a variable, <tt>b</tt> is fixed.
*/
public static IntFunction plus(final int b) {
  return new IntFunction() {
    public final int apply(int a) { return a + b; }
  };
}
View Full Code Here

/**
* Constructs a function that returns <tt>(int) Math.pow(a,b)</tt>.
* <tt>a</tt> is a variable, <tt>b</tt> is fixed.
*/
public static IntFunction pow(final int b) {
  return new IntFunction() {
    public final int apply(int a) { return (int) Math.pow(a,b); }
  };
}
View Full Code Here

/**
* Constructs a function that returns <tt>a << b</tt>.
* <tt>a</tt> is a variable, <tt>b</tt> is fixed.
*/
public static IntFunction shiftLeft(final int b) {
  return new IntFunction() {
    public final int apply(int a) { return a << b; }
  };
}
View Full Code Here

/**
* Constructs a function that returns <tt>a >> b</tt>.
* <tt>a</tt> is a variable, <tt>b</tt> is fixed.
*/
public static IntFunction shiftRightSigned(final int b) {
  return new IntFunction() {
    public final int apply(int a) { return a >> b; }
  };
}
View Full Code Here

/**
* Constructs a function that returns <tt>a >>> b</tt>.
* <tt>a</tt> is a variable, <tt>b</tt> is fixed.
*/
public static IntFunction shiftRightUnsigned(final int b) {
  return new IntFunction() {
    public final int apply(int a) { return a >>> b; }
  };
}
View Full Code Here

TOP

Related Classes of cern.colt.function.IntFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.