FileDocCategorySizeDatePackage
Int2.javaAPI DocAndroid 5.1 API7943Thu Mar 12 22:22:42 GMT 2015android.renderscript

Int2

public class Int2 extends Object
Vector version of the basic int type. Provides two int fields packed.

Fields Summary
public int
x
public int
y
Constructors Summary
public Int2()

    
public Int2(int i)

hide

        this.x = this.y = i;
    
public Int2(int x, int y)

        this.x = x;
        this.y = y;
    
public Int2(Int2 source)

hide

        this.x = source.x;
        this.y = source.y;
    
Methods Summary
public voidadd(android.renderscript.Int2 a)

hide
Vector add
param
a

        this.x += a.x;
        this.y += a.y;
    
public static android.renderscript.Int2add(android.renderscript.Int2 a, android.renderscript.Int2 b)

hide
Vector add
param
a
param
b
return

        Int2 result = new Int2();
        result.x = a.x + b.x;
        result.y = a.y + b.y;

        return result;
    
public voidadd(int value)

hide
Vector add
param
value

        x += value;
        y += value;
    
public static android.renderscript.Int2add(android.renderscript.Int2 a, int b)

hide
Vector add
param
a
param
b
return

        Int2 result = new Int2();
        result.x = a.x + b;
        result.y = a.y + b;

        return result;
    
public voidaddAt(int i, int value)

hide
add the vector field value by index
param
i
param
value

        switch (i) {
        case 0:
            x += value;
            return;
        case 1:
            y += value;
            return;
        default:
            throw new IndexOutOfBoundsException("Index: i");
        }
    
public voidaddMultiple(android.renderscript.Int2 a, int factor)

hide
Vector add Multiple
param
a
param
factor

        x += a.x * factor;
        y += a.y * factor;
    
public voidcopyTo(int[] data, int offset)

hide
copy the vector to int array
param
data
param
offset

        data[offset] = (int)(x);
        data[offset + 1] = (int)(y);
    
public voiddiv(android.renderscript.Int2 a)

hide
Vector division
param
a

        this.x /= a.x;
        this.y /= a.y;
    
public static android.renderscript.Int2div(android.renderscript.Int2 a, android.renderscript.Int2 b)

hide
Vector division
param
a
param
b
return

        Int2 result = new Int2();
        result.x = a.x / b.x;
        result.y = a.y / b.y;

        return result;
    
public voiddiv(int value)

hide
Vector division
param
value

        x /= value;
        y /= value;
    
public static android.renderscript.Int2div(android.renderscript.Int2 a, int b)

hide
Vector division
param
a
param
b
return

        Int2 result = new Int2();
        result.x = a.x / b;
        result.y = a.y / b;

        return result;
    
public intdotProduct(android.renderscript.Int2 a)

hide
Vector dot Product
param
a
return

        return (int)((x * a.x) + (y * a.y));
    
public static intdotProduct(android.renderscript.Int2 a, android.renderscript.Int2 b)

hide
Vector dot Product
param
a
param
b
return

        return (int)((b.x * a.x) + (b.y * a.y));
    
public intelementSum()

hide
return the element sum of vector
return

        return (int)(x + y);
    
public intget(int i)

hide
get the vector field value by index
param
i
return

        switch (i) {
        case 0:
            return (int)(x);
        case 1:
            return (int)(y);
        default:
            throw new IndexOutOfBoundsException("Index: i");
        }
    
public intlength()

hide
get vector length
return

        return 2;
    
public voidmod(android.renderscript.Int2 a)

hide
Vector Modulo
param
a

        this.x %= a.x;
        this.y %= a.y;
    
public static android.renderscript.Int2mod(android.renderscript.Int2 a, android.renderscript.Int2 b)

hide
Vector Modulo
param
a
param
b
return

        Int2 result = new Int2();
        result.x = a.x % b.x;
        result.y = a.y % b.y;

        return result;
    
public voidmod(int value)

hide
Vector Modulo
param
value

        x %= value;
        y %= value;
    
public static android.renderscript.Int2mod(android.renderscript.Int2 a, int b)

hide
Vector Modulo
param
a
param
b
return

        Int2 result = new Int2();
        result.x = a.x % b;
        result.y = a.y % b;

        return result;
    
public voidmul(android.renderscript.Int2 a)

hide
Vector multiplication
param
a

        this.x *= a.x;
        this.y *= a.y;
    
public static android.renderscript.Int2mul(android.renderscript.Int2 a, android.renderscript.Int2 b)

hide
Vector multiplication
param
a
param
b
return

        Int2 result = new Int2();
        result.x = a.x * b.x;
        result.y = a.y * b.y;

        return result;
    
public voidmul(int value)

hide
Vector multiplication
param
value

        x *= value;
        y *= value;
    
public static android.renderscript.Int2mul(android.renderscript.Int2 a, int b)

hide
Vector multiplication
param
a
param
b
return

        Int2 result = new Int2();
        result.x = a.x * b;
        result.y = a.y * b;

        return result;
    
public voidnegate()

hide
set vector negate

        this.x = -x;
        this.y = -y;
    
public voidset(android.renderscript.Int2 a)

hide
set vector value by Int2
param
a

        this.x = a.x;
        this.y = a.y;
    
public voidsetAt(int i, int value)

hide
set the vector field value by index
param
i
param
value

        switch (i) {
        case 0:
            x = value;
            return;
        case 1:
            y = value;
            return;
        default:
            throw new IndexOutOfBoundsException("Index: i");
        }
    
public voidsetValues(int a, int b)

hide
set the vector field value by Int
param
a
param
b

        this.x = a;
        this.y = b;
    
public static android.renderscript.Int2sub(android.renderscript.Int2 a, android.renderscript.Int2 b)

hide
Vector subtraction
param
a
param
b
return

        Int2 result = new Int2();
        result.x = a.x - b.x;
        result.y = a.y - b.y;

        return result;
    
public voidsub(int value)

hide
Vector subtraction
param
value

        x -= value;
        y -= value;
    
public static android.renderscript.Int2sub(android.renderscript.Int2 a, int b)

hide
Vector subtraction
param
a
param
b
return

        Int2 result = new Int2();
        result.x = a.x - b;
        result.y = a.y - b;

        return result;
    
public voidsub(android.renderscript.Int2 a)

hide
Vector subtraction
param
a

        this.x -= a.x;
        this.y -= a.y;