org.uacalc.util
Class IntArray
java.lang.Object
org.uacalc.util.IntArray
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- BasicPartition, BasicSet
public class IntArray
- extends java.lang.Object
- implements java.lang.Cloneable
This class is a wrapper for an array of int's mainly so we can
specify the equals and hashCode methods.
- Version:
- $Id: IntArray.java,v 1.7 2011/04/03 01:25:33 ralphfreese Exp $
- Author:
- Ralph Freese
|
Field Summary |
protected int[] |
array
|
protected int |
size
|
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
size
protected int size
array
protected int[] array
IntArray
public IntArray()
IntArray
public IntArray(int[] array)
IntArray
public IntArray(int size)
satisfiesConstraint
public boolean satisfiesConstraint(int[][] blocks)
satisfiesConstraint
public boolean satisfiesConstraint(int[][] blocks,
int[][] values)
- Checks if this intArray is equal on the indices of each block and
has the values specified by
values.
- Parameters:
blocks - an array of the level blocksvalues - an array of pairs [i,v] specifying array[i] = v
- Returns:
- true if the condition is satisfied
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equals in class java.lang.Object
hashCode
public final int hashCode()
- Overrides:
hashCode in class java.lang.Object
toArray
public final int[] toArray()
getArray
public final int[] getArray()
universeSize
public final int universeSize()
setIntArray
public final void setIntArray(int[] v)
get
public final int get(int i)
set
public final void set(int index,
int value)
isIdempotent
public boolean isIdempotent()
- Test if this represents an idempotent function; that is,
one satisfying the equation f(f(x)) ≈ f(x).
- Returns:
true iff f(f(x)) = f(x) for all 0 ≤ x < size.
lexicographicComparitor
public static java.util.Comparator<IntArray> lexicographicComparitor()
clone
public java.lang.Object clone()
- Overrides:
clone in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
intArrayToString
public static final java.lang.String intArrayToString(int[] array)
equalIntArrays
public static final boolean equalIntArrays(int[] u,
int[] v)
Copyright 2003 Ralph Freese. All Rights Reserved.