6 import java.io.BufferedReader;
7 import java.io.PrintWriter;
8 import java.io.IOException;
15 this(vec2fs.length, vec2fs);
19 for (
int i = 0; i < size; i += 2)
20 __vect.addElement(
new ConstSFVec2f(vec2fs[i], vec2fs[i+1]));
24 for (
int i = 0; i < vec2fs.length; i++)
25 __vect.addElement(
new ConstSFVec2f(vec2fs[i][0], vec2fs[i][1]));
28 public void getValue(
float[] vec2fs) {
30 int size = __vect.size();
31 for (
int i = 0; i < size; i++) {
33 vec2fs[2*i+0] = sfVec2f.x;
34 vec2fs[2*i+1] = sfVec2f.y;
38 public void getValue(
float[][] vec2fs) {
40 int size = __vect.size();
41 for (
int i = 0; i < size; i++)
42 ((
ConstSFVec2f) __vect.elementAt(i)).getValue(vec2fs[i]);
45 public void get1Value(
int index,
float[] vec2fs) {
47 ((
ConstSFVec2f) __vect.elementAt(index)).getValue(vec2fs);
50 public void get1Value(
int index,
SFVec2f sfVec2f) {
52 sfVec2f.setValue((
ConstSFVec2f) __vect.elementAt(index));
55 public String toString() {
57 StringBuffer sb =
new StringBuffer(
"[");
58 int size = __vect.size();
59 for (
int i = 0; i < size; i++) {
60 if (i > 0) sb.append(
", ");
61 sb.append(__vect.elementAt(i));
63 return sb.append(
"]").toString();
66 public void __fromPerl(BufferedReader in)
throws IOException {
68 String lenline = in.readLine();
71 int len = Integer.parseInt(lenline);
72 for (
int i = 0; i < len; i++) {
75 __vect.addElement(sf);
79 public void __toPerl(PrintWriter out)
throws IOException {
80 StringBuffer sb =
new StringBuffer(
"");
81 int size = __vect.size();
83 for (
int i = 0; i < size; i++) {
85 if (i != (size-1)) out.print (
", ");