public class IntArray extends Object
Constructor | Description |
---|---|
IntArray() |
Construct a default IntArray, size 0 and surly a sort should not occur.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addToArray(int value) |
Adds a value to the array.
|
void |
clear(boolean resize) |
Clear the IntArray (set all elements to zero).
|
boolean |
equals(Object o) |
Equals method.
|
int |
get(int i) |
Get an element from a specific index.
|
int |
hashCode() |
Calculates a hash-code for HashTables
|
void |
intersect(IntArray other) |
Intersects the data with a given IntArray
|
void |
intersect(IntHashSet set) |
Intersects the data with a given
IntHashSet . |
void |
set(int idx,
int value) |
|
int |
size() |
Return the size of the Array.
|
void |
sort() |
Sorts the data.
|
String |
toString() |
toString or not toString.
|
public IntArray()
public void intersect(IntHashSet set)
IntHashSet
.set
- A given ArrayHashSetInt which holds the data to be intersected
againstpublic void intersect(IntArray other)
other
- A given IntArray which holds the data to be intersected againspublic int size()
public void addToArray(int value)
value
- value to be addedpublic boolean equals(Object o)
public void sort()
public int hashCode()
public int get(int i)
i
- index of which element should be retrieved.public void set(int idx, int value)
public String toString()
public void clear(boolean resize)
resize
- - if resize is true, then clear actually allocates
a new array of size 0, essentially 'clearing' the array and freeing
memory.Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.