本文整理汇总了Java中com.google.gwt.core.client.JsArrayInteger.createArray方法的典型用法代码示例。如果您正苦于以下问题:Java JsArrayInteger.createArray方法的具体用法?Java JsArrayInteger.createArray怎么用?Java JsArrayInteger.createArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.core.client.JsArrayInteger
的用法示例。
在下文中一共展示了JsArrayInteger.createArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import com.google.gwt.core.client.JsArrayInteger; //导入方法依赖的package包/类
@Override
public JsMessage convert(Message value) {
JsMessenger messenger = JsMessenger.getInstance();
String rid = value.getRid() + "";
String sortKey = value.getSortDate() + "";
JsPeerInfo sender = messenger.buildPeerInfo(Peer.user(value.getSenderId()));
boolean isOut = value.getSenderId() == messenger.myUid();
boolean isOnServer = value.isOnServer();
String date = messenger.getFormatter().formatTime(value.getDate());
JsDate fullDate = JsDate.create(value.getDate());
JsContent content = JsContent.createContent(value.getContent(),
value.getSenderId());
JsArray<JsReaction> reactions = JsArray.createArray().cast();
for (Reaction r : value.getReactions()) {
JsArrayInteger uids = (JsArrayInteger) JsArrayInteger.createArray();
boolean isOwnSet = false;
for (Integer i : r.getUids()) {
uids.push(i);
if (i == messenger.myUid()) {
isOwnSet = true;
}
}
reactions.push(JsReaction.create(r.getCode(), uids, isOwnSet));
}
double sortDate = value.getDate() / 1000.0;
return create(rid, sortKey, sender, isOut, date, fullDate, Enums.convert(value.getMessageState()), isOnServer, content,
reactions, sortDate);
}
示例2: toJsArray
import com.google.gwt.core.client.JsArrayInteger; //导入方法依赖的package包/类
public static JsArrayInteger toJsArray(byte[] data) {
JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
int len = data.length;
for (int i = len - 1; i >= 0; i--) {
jsan.set(i, data[i]);
}
return jsan;
}
示例3: toJsArrayUnsigned
import com.google.gwt.core.client.JsArrayInteger; //导入方法依赖的package包/类
public static JsArrayInteger toJsArrayUnsigned(byte[] data) {
JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
int len = data.length;
for (int i = len - 1; i >= 0; i--) {
jsan.set(i, data[i] & 255);
}
return jsan;
}
示例4: play
import com.google.gwt.core.client.JsArrayInteger; //导入方法依赖的package包/类
void play() {
int i;
JsArrayInteger arr = (JsArrayInteger)JsArrayInteger.createArray();
int ct = dataPtr;
int base = 0;
if (dataFull) {
ct = dataCount;
base = dataPtr;
}
if (ct * sampleStep < .05) {
Window.alert("Audio data is not ready yet. Increase simulation speed to make data ready sooner.");
return;
}
// rescale data to maximize
double max = -1e8;
double min = 1e8;
for (i = 0; i != ct; i++) {
if (data[i] > max) max = data[i];
if (data[i] < min) min = data[i];
}
double adj = -(max+min)/2;
double mult = 32766/(max+adj);
for (i = 0; i != ct; i++) {
int s = (int)((data[(i+base)%dataCount]+adj)*mult);
arr.push(s);
}
playJS(arr, samplingRate);
}
示例5: JsPoint
import com.google.gwt.core.client.JsArrayInteger; //导入方法依赖的package包/类
public JsPoint(int x, int y) {
JsArrayInteger jsX = (JsArrayInteger)JsArrayInteger.createArray();
jsX.push(x);
array.set(0, jsX);
JsArrayInteger jsY = (JsArrayInteger)JsArrayInteger.createArray();
jsY.push(y);
array.set(1, jsY);
}