Skip to content
Merged

Dev #130

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 43 additions & 35 deletions scouter.common/src/scouter/lang/value/ListValue.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
/*
* Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package scouter.lang.value;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import scouter.io.DataInputX;
import scouter.io.DataOutputX;
import scouter.io.DataInputX;
import scouter.io.DataOutputX;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

public class ListValue implements Value {

Expand Down Expand Up @@ -62,19 +62,27 @@ public double getDouble(int i) {
return 0;
}

public double getFloat(int i) {
Value v = valueList.get(i);
if (v instanceof Number) {
return ((Number) v).floatValue();
}
return 0;
}

public long getLong(int i) {
Value v = valueList.get(i);
if (v instanceof Number) {
return ((Number) v).longValue();
}
return 0;
}
public int getInt(int i) {
Value v = valueList.get(i);
if (v instanceof Number) {
return ((Number) v).intValue();
}
return 0;
public int getInt(int i) {
Value v = valueList.get(i);
if (v instanceof Number) {
return ((Number) v).intValue();
}
return 0;
}
public String getString(int i) {
Value v = valueList.get(i);
Expand Down Expand Up @@ -191,10 +199,10 @@ public ListValue add(String[] str) {
this.add(s);
}
return this;
}

public Iterator<Value> iterator() {
return this.valueList.iterator();
}
public Iterator<Value> iterator() {
return this.valueList.iterator();
}

public String[] toStringArray() {
Expand Down