/
VectorInterface.java
59 lines (48 loc) · 1.58 KB
/
VectorInterface.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* AbstractVector.java
*
* Created on 18. March 2006, 15:55
* This stands under Public domain
*/
package de.genvlin.core.data;
/** This interface defines method to access a Vector of Number.
* Known implementations are {@link DataVector} and extension
* {@link DoubleVectorInterface}.
*
* @author Peter Karich
*/
public interface VectorInterface extends CollectionInterface {
/** This method adds a Number to the vector */
public boolean add(Number o);
/** This method adds a double to the vector */
public boolean addDouble(double d);
/**
* This method appends a {@link Collection} to this
* vector.<br>
* It returns true if successfully added, false otherwise.
*/
public boolean addAll(java.util.Collection<? extends Number> coll);
/** This method returns the i-th element in the vector */
public Number get(int i);
/** This method returns the i-th element in the vector */
public double getDouble(int i);
/**
* This method sets the i-th element to the specified one.
* It returns the old element.
*/
public Number set(int i, Number n);
/**
* @return the minimal entry in this object
*/
public Number getMin();
/**
* @return the maximal entry in this object
*/
public Number getMax();
/**
* This method ensure that the set method will not fire NullPointer
* Exceptions until the new size.
* @param size the new size of the VectorInterface's implementation.
*/
public void trimToSize(int size);
}