本文整理匯總了Java中javafx.util.Pair.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Pair.getValue方法的具體用法?Java Pair.getValue怎麽用?Java Pair.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.util.Pair
的用法示例。
在下文中一共展示了Pair.getValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadWord2VecfModel
import javafx.util.Pair; //導入方法依賴的package包/類
/** @return {@link Word2Vecf} */
public static Word2Vecf loadWord2VecfModel (String wordFilePath, String contextFilePath, boolean binary) {
Word2Vecf model = null;
try {
Pair<List<String>, INDArray> wordPair;
Pair<List<String>, INDArray> contextPair;
if (binary) {
wordPair = fromBinary(wordFilePath);
contextPair = fromBinary(contextFilePath);
} else {
wordPair = fromText(wordFilePath);
contextPair = fromText(contextFilePath);
}
model = new Word2Vecf(wordPair.getValue().columns(), wordPair.getKey(), wordPair.getValue(), contextPair.getKey(), contextPair.getValue(), true);
} catch (IOException e) {
e.printStackTrace();
}
return model;
}
示例2: Set
import javafx.util.Pair; //導入方法依賴的package包/類
public void Set(State forState, int depth, Stack<GraphNode> jumpStack, SparseBitSet shiftedBitmask, SparseBitSet shiftedRez) {
Map<String, Pair<SparseBitSet, SparseBitSet>> forStateCache = cache.get(forState);
if (forStateCache == null)
cache.put(forState, forStateCache = new HashMap<String, Pair<SparseBitSet, SparseBitSet>>());
String key = keyForJumpStack(jumpStack);
Pair<SparseBitSet, SparseBitSet> prevToRez = forStateCache.get(key);
if (depth != 0) {
shiftedRez = shiftedRez.clone();
shiftedBitmask = shiftedBitmask.clone();
}
ShiftOnSentences(shiftedBitmask, input, depth);
ShiftOnSentences(shiftedRez, input, depth);
if (prevToRez == null) {
shiftedRez.locked = true;
shiftedBitmask.locked = true;
forStateCache.put(key, new Pair<SparseBitSet, SparseBitSet>(shiftedBitmask, shiftedRez));
} else {
prevToRez.getKey().locked = false;
prevToRez.getKey().or(shiftedBitmask);
prevToRez.getKey().locked = true;
prevToRez.getValue().locked = false;
prevToRez.getValue().or(shiftedRez);
prevToRez.getValue().locked = true;
}
}
示例3: BanCategory
import javafx.util.Pair; //導入方法依賴的package包/類
public BanCategory(String s, int id) {
if(!REGEX.matcher(s).matches()) return;
this.rawString = s;
this.id = id;
String[] split = s.split(":");
this.name = split[0];
String[] split0 = split[1].split(";");
// list duration
Pair<Integer, TimeUnit> timeDuration = TimeUtil.getTime(split0[0]);
this.duration = timeDuration.getKey();
this.timeUnit = timeDuration.getValue();
// banType
this.banType = split0.length > 1
? split0[1].equalsIgnoreCase(BanType.CHAT.name())
? BanType.CHAT : BanType.GLOBAL : BanType.GLOBAL;
}
示例4: formatConditioned
import javafx.util.Pair; //導入方法依賴的package包/類
/**
* Formats an event syntax with given events and replacements
*
* @param hoverAction The action for an {@link HoverEvent}
* @param clickAction The action for an {@link ClickEvent}
* @param condition false = no events; true = events
* @param replacements The replacements
* @return This
*/
public MessageComponent formatConditioned(HoverEvent.Action hoverAction, ClickEvent.Action clickAction, boolean condition, Object... replacements) {
EventEntry eventEntry = null;
for(int i = entryCursor; i < entryList.size(); i++) {
Pair<String, TextEntry> entry = entryList.get(i);
TextEntry value = entry.getValue();
if(value instanceof EventEntry) {
this.entryCursor = i + 1;
eventEntry = (EventEntry) value;
break;
}
}
if(eventEntry == null) return this;
eventEntry = eventEntry.initSyntax(StringUtil.format(eventEntry.getHandle(), replacements));
// set events if the condition is true
if(condition) {
eventEntry.initEvents(hoverAction, clickAction);
}
formatted = true;
return this;
}
示例5: deserializeHashEntry
import javafx.util.Pair; //導入方法依賴的package包/類
public static Hashtable<String,ArrayList<Microblog>> deserializeHashEntry(
byte[] keyData, Scheme scheme) {
ByteStream byteStream = new ByteStream(keyData);
int offset = 0;
Pair<String,Integer> result = deserializeKey(byteStream);
String deserializedKey = result.getKey();
int deserializedLen = result.getValue();
offset = deserializedLen;
ArrayList<Microblog> microblogs = deserializeValue(byteStream, scheme);
Hashtable<String, ArrayList<Microblog>> singleHashEntry = new
Hashtable<>();
singleHashEntry.put(deserializedKey, microblogs);
return singleHashEntry;
}
示例6: onTreeClick
import javafx.util.Pair; //導入方法依賴的package包/類
private void onTreeClick(MouseEvent event)
{
if (event.getClickCount() == 2)
{
if (onFileDoubleClicked != null)
{
Pair<Project, ASMFile> selection = getActiveSelection();
if (selection == null)
return;
ASMFile selectedFile = selection.getValue();
if (selectedFile != null)
onFileDoubleClicked.accept(selectedFile);
}
}
}
示例7: TreeDrawerNode
import javafx.util.Pair; //導入方法依賴的package包/類
TreeDrawerNode(TreeNode treeNode, TreeDrawerNode parentDrawer) {
Pair<Integer, Integer> trialCoords = new Pair<>(treeNode.getDepth(), parentDrawer.getY());
while (nodeMap.containsKey(trialCoords)) {
trialCoords = new Pair<>(trialCoords.getKey(), trialCoords.getValue() + 1);
}
setup(treeNode, trialCoords.getKey(), trialCoords.getValue());
parent = parentDrawer;
}
示例8: post
import javafx.util.Pair; //導入方法依賴的package包/類
/**
* Posts an event
*
* @param event The event to post
*/
public void post(Object event) {
Class<?> eventClass = event.getClass();
while(eventClass != Object.class) {
for(Pair<Object, EventHandler> h : getHandlers(eventClass, Listener.Priority.MEDIUM)) {
EventHandler handler = h.getValue();
handler.handle(event);
}
eventClass = eventClass.getSuperclass();
}
}
示例9: parseLine
import javafx.util.Pair; //導入方法依賴的package包/類
public static Pair<FieldRef, FieldRef> parseLine(String fieldLine) {
String[] splitted = fieldLine.split(" ");
Pair<String, String> fieldA = MethodRef.parseOwnerAndName(splitted[1]);
Pair<String, String> fieldB = MethodRef.parseOwnerAndName(splitted[2]);
return new Pair<>(new FieldRef(fieldA.getKey(), fieldA.getValue()), new FieldRef(fieldB
.getKey(), fieldB.getValue()));
}
示例10: PlaceBlock
import javafx.util.Pair; //導入方法依賴的package包/類
public PlaceBlock(AgentHost agentHost, BlockAt blockAt) {
super(agentHost);
float x = blockAt.getX();
float y = blockAt.getY();
float z = blockAt.getZ();
mBlockAt = blockAt;
Observations observations = ObservationFactory.getObservations(agentHost);
String typeOfBlockString = blockAt.getTypeOfBlockString();
Have have = new Have(typeOfBlockString, observations.numberOf(typeOfBlockString) - 1);
effects.add(blockAt);
effects.add(have);
Pair<BlockAt, LookingAt> bestNearby = findBestNearbyBlock(x, y, z, observations);
float placeDistance = 1;
LookingAt lookingAt = bestNearby.getValue();
if (bestNearby.getKey().getY() == observations.YPos) {
needsToJump = true;
// Look down instead of up (because we'll jump)
lookingAt = new LookingAt(lookingAt.getX(), lookingAt.getY()-1.5f, lookingAt.getZ());
} else if (bestNearby.getKey().getY() > observations.YPos) {
// We don't need to jump, but we need to be exactly below the block we want to place
placeDistance = 0;
}
this.preconditions = Arrays.asList(
new Have(typeOfBlockString, 1),
new HaveSelected(typeOfBlockString),
bestNearby.getKey(),
lookingAt,
new IsAt(x, y, z, placeDistance, true, needsToJump), // Distance must be exact in this case (not less or equal)
new BlockAt(x, y, z, BlockType.air)
);
}
示例11: decrementIndexCount
import javafx.util.Pair; //導入方法依賴的package包/類
public void decrementIndexCount(long id) {
Pair<Integer,Integer> locator = locateRecord(id);
int chunkId = locator.getKey();
int chunckInd = locator.getValue();
if(chunkId < 0) {
if(currIndexesCount[chunckInd] != null)
currIndexesCount[chunckInd]--;
}
else {
if(indexesCount.get(chunkId)[chunckInd] != null)
indexesCount.get(chunkId)[chunckInd]--;
}
}
示例12: getEventSize
import javafx.util.Pair; //導入方法依賴的package包/類
/**
* Get the size of the founded events
*
* @return The size as int
*/
public int getEventSize() {
int i = 0;
for(Pair<String, TextEntry> entry : entryList) {
if(entry.getValue() instanceof EventEntry) i++;
}
return i;
}
示例13: search
import javafx.util.Pair; //導入方法依賴的package包/類
@Override
public ArrayList<Microblog> search(GeoLocation key, int k, Query query) {
ArrayList<Microblog> results = new ArrayList<>();
if(directoryEntries == null || directoryEntries.isEmpty())
directoryEntries = loadDirectory(directoryFileFolder,
directoryFileId);
if(query.isSpatialRange()) {
Rectangle queryRange = key.isPoint()? query.getParam_Rectangle
("SpatialRange"): (Rectangle)key;
if(this.spatialPartitioner == null)
this.spatialPartitioner = deserializeSpatialPartitioner(
spatialPartitionerFilePath);
List<Integer> partitionIds = this.spatialPartitioner.overlap
(queryRange);
for(int i = 0; i < directoryEntries.size() && results.size() < k;
++i) {
Integer paritionId = directoryEntries.get(i).getKeyGeo();
if(paritionId != null && partitionIds.contains(paritionId)) {
Pair<Integer,ArrayList<Microblog>> microblogs =
readPartitionMicroblogs (directoryEntries.get(i),
queryRange);
ArrayList<Microblog> records = microblogs.getValue();
if(query.isSingleSearchAttribute())
results.addAll(records);
else {
for(Microblog record: records)
if(record.match(query.getCondition()))
results.add(record);
}
}
}
} else if(query.isSpatialKNN()) {
//ToDo: implement kNN
}
return results;
}
示例14: start
import javafx.util.Pair; //導入方法依賴的package包/類
@Override
public void start(Stage stage) throws Exception {
Pair<MainFrameController, Pane> pair = Util.renderFxml(MainFrameController.class);
Pane root = pair.getValue();
pair.getKey().setStage(stage);
Scene scene = Util.createScene(root);
stage.setScene(scene);
stage.setMaximized(true);
stage.show();
stage.getIcons().add(new Image(CSSMain.class.getClassLoader().getResourceAsStream("image/icon.png")));
}
示例15: getActiveFileInProjectExplorer
import javafx.util.Pair; //導入方法依賴的package包/類
private ASMFile getActiveFileInProjectExplorer()
{
Pair<Project, ASMFile> selection = projectExplorer.getActiveSelection();
if (selection == null)
return null;
ASMFile selectedFile = selection.getValue();
return selectedFile;
}