本文整理汇总了Java中com.google.gwt.core.client.JsArrayNumber类的典型用法代码示例。如果您正苦于以下问题:Java JsArrayNumber类的具体用法?Java JsArrayNumber怎么用?Java JsArrayNumber使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JsArrayNumber类属于com.google.gwt.core.client包,在下文中一共展示了JsArrayNumber类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setIncrementalData
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
void setIncrementalData(JsArrayNumber domain, JsArray<JsArrayNumber> rangeArray) {
int len = domain.length(); // using this length for both
double d[] = new double[len];
for(int i=0; i<d.length; i++) {
d[i] = domain.get(i);
}
int rangeArrayLength = rangeArray.length();
Array1D[] ranges = new Array1DImpl[rangeArray.length()];
for (int dimension = 0; dimension < rangeArrayLength; dimension++) {
double[] r = new double[len];
for(int j=0; j < r.length; j++) {
r[j] = rangeArray.get(dimension).get(j);
}
ranges[dimension] = new Array1DImpl(r);
}
incremental = new MipMap(new Array1DImpl(d), ranges, -1, getMipMapChain().getMipMap(0));
Interval region = new Interval(d[0], d[d.length - 1]);
incrementalInterval = region;
outgoingRequest = System.currentTimeMillis();
firing = true;
datasets.fireChanged(this, region);
firing = false;
}
示例2: compareJsArrayNumber
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
public String compareJsArrayNumber(JsArrayNumber objectA,JsArrayNumber objectB){
if(objectA==null){
if(objectB==null){
return "";//no need check
}else{
return "A is null,B's length is "+objectB.length();
}
}
if(objectB==null){
return "A is"+objectA.length()+",but B is Empty";
}
if(objectA.length()!=objectB.length()){
return "A's length"+objectA.length()+",B's length is "+objectB.length();
}
for(int i=0;i<objectA.length();i++){
if(objectA.get(i)!=objectB.get(i)){
return "difference value at:"+i;
}
}
return "";
}
示例3: flipV
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
public void flipV(JSONModelFile model){
JsArray<JsArrayNumber> uvs= model.getUvs();
if(uvs==null){
return;
}
for(int i=0;i<uvs.length();i++){
JsArrayNumber array=uvs.get(i);
for(int j=0;j<array.length();j++){
if(j%2==1){//v only
double old=array.get(j);
array.set(j, 1-old);
}
}
}
}
示例4: doDeserializeArray
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public double[] doDeserializeArray( JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params ) {
JsArrayNumber jsArray = JsArrayNumber.createArray().cast();
reader.beginArray();
while ( JsonToken.END_ARRAY != reader.peek() ) {
if ( JsonToken.NULL == reader.peek() ) {
reader.skipValue();
jsArray.push( DEFAULT );
} else {
jsArray.push( reader.nextDouble() );
}
}
reader.endArray();
if ( GWT.isScript() ) {
return reinterpretCast( jsArray );
} else {
int length = jsArray.length();
double[] ret = new double[length];
for ( int i = 0; i < length; i++ ) {
ret[i] = jsArray.get( i );
}
return ret;
}
}
示例5: getNumberArrayAttribute
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
private List<Double> getNumberArrayAttribute(SliderOption option, List<Double> defaultValue) {
// Get array attribute
JsArrayNumber array = null;
if (isAttached()) {
array = getNumberArrayAttribute(getElement(), option.getName());
} else {
String value = attributeMixin.getAttribute(option.getDataAttribute());
if (value != null && !value.isEmpty()) {
array = JsonUtils.safeEval(value);
}
}
// Attribute not set
if (array == null) {
return defaultValue;
}
// Put array to list
List<Double> list = new ArrayList<Double>(array.length());
for (int i = 0; i < array.length(); i++) {
list.add(array.get(i));
}
return list;
}
示例6: JsIntegerArrayList
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
/**
* Internal constructor used to load a JSArray already in another object.
* @param array JS array instance
*/
JsIntegerArrayList(JsArrayIntegerImpl array) {
// if null, creates a new JS array
if (array == null){
this.array = (JsArrayIntegerImpl)JsArrayNumber.createArray().cast();
} else {
// uses an existing array
this.array = array;
}
}
示例7: JsDoubleArrayList
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
/**
* Internal constructor used to load a JSArray already in another object.
* @param array JS array instance
*/
JsDoubleArrayList(JsArrayDoubleImpl array) {
// if null, creates a new JS array
if (array == null){
this.array = (JsArrayDoubleImpl)JsArrayNumber.createArray().cast();
} else {
// uses an existing array
this.array = array;
}
}
示例8: toJsArray
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
public static JsArrayNumber toJsArray(double[] data) {
JsArrayNumber jsan = (JsArrayNumber) JsArrayNumber.createArray();
int len = data.length;
for (int i = len - 1; i >= 0; i--) {
jsan.set(i, data[i]);
}
return jsan;
}
示例9: setValue
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
public void setValue(int row, int col, double val) {
JsArrayNumber arr = data.get(col);
if (arr == null) {
arr = JsArrayNumber.createArray().cast();
data.set(col, arr);
}
arr.set(row, val);
}
示例10: getTupleRange
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
public JsonArray<JsonArrayNumber> getTupleRange() {
JsArray<JsArrayNumber> tupleRange = jso.getTupleRange();
if (tupleRange != null) {
return new GwtJsonArrayOverlay<JsonArrayNumber>(tupleRange,
JsonArrayNumber.class);
}
return null;
}
示例11: get
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
public T get(int i) {
T wrapper = null;
if (parameterType == JsonArrayNumber.class) {
wrapper = (T) new GwtJsonArrayNumber((JsArrayNumber) jso.get(i));
} else if(parameterType == JsonArrayString.class) {
wrapper = (T) new GwtJsonArrayString((JsArrayString) jso.get(i));
}
return wrapper;
}
示例12: fromDoubles
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
public static JsArrayNumber fromDoubles(Collection<Double> collection) {
JsArrayNumber array = JsArrayNumber.createArray().cast();
for(Double item : collection) {
array.push(item);
}
return array;
}
示例13: toList
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
public static List<Double> toList(JsArrayNumber array) {
List<Double> list = new ArrayList<>();
if(array != null) {
for (int i = 0; i < array.length(); i++) {
list.add(array.get(i));
}
}
return list;
}
示例14: checkForDoubleAryResult
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
private static void checkForDoubleAryResult(String key, WebPlotResult wpRes,PlotResultOverlay res) {
JsArrayNumber jsAry= res.getDoubleArrayResult(key);
if (jsAry!=null) {
double ary[]= new double[jsAry.length()];
for(int i= 0; (i<ary.length); i++) ary[i]= jsAry.get(i);
wpRes.putResult(key,new DataEntry.DoubleArray(ary));
}
}
示例15: getDoubleArrayResult
import com.google.gwt.core.client.JsArrayNumber; //导入依赖的package包/类
public final native JsArrayNumber getDoubleArrayResult(String key) /*-{
if (key in this) {
return this[key];
}
else {
return null;
}
}-*/;