當前位置: 首頁>>代碼示例>>Java>>正文


Java Pair.getValue方法代碼示例

本文整理匯總了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;
}
 
開發者ID:IsaacChanghau,項目名稱:Word2VecfJava,代碼行數:20,代碼來源:WordVectorSerializer.java

示例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;
    }
}
 
開發者ID:radsimu,項目名稱:UaicNlpToolkit,代碼行數:27,代碼來源:SearchSpaceReducer.java

示例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;
}
 
開發者ID:Superioz,項目名稱:MooProject,代碼行數:20,代碼來源:BanCategory.java

示例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;
}
 
開發者ID:Superioz,項目名稱:MooProject,代碼行數:32,代碼來源:MessageComponent.java

示例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;
}
 
開發者ID:amrmagdy4,項目名稱:kite,代碼行數:18,代碼來源:Serializer.java

示例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);
		}
	}
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:17,代碼來源:ProjectExplorerTree.java

示例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;
}
 
開發者ID:GoSuji,項目名稱:Suji,代碼行數:11,代碼來源:TreeDrawer.java

示例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();
    }
}
 
開發者ID:BRjDevs,項目名稱:BRjLibs,代碼行數:16,代碼來源:EventBus.java

示例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()));
}
 
開發者ID:PizzaCrust,項目名稱:Mixinite,代碼行數:8,代碼來源:FieldRef.java

示例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)
    );
}
 
開發者ID:carlo-,項目名稱:MalmoAgent,代碼行數:37,代碼來源:PlaceBlock.java

示例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]--;
    }
}
 
開發者ID:amrmagdy4,項目名稱:kite,代碼行數:14,代碼來源:ArrayBigDataset.java

示例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;
}
 
開發者ID:Superioz,項目名稱:MooProject,代碼行數:14,代碼來源:MessageComponent.java

示例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;
}
 
開發者ID:amrmagdy4,項目名稱:kite,代碼行數:41,代碼來源:DiskSpatialIndexSegment.java

示例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")));
}
 
開發者ID:XDean,項目名稱:CSS-Editor-FX,代碼行數:16,代碼來源:CSSMain.java

示例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;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:10,代碼來源:Main.java


注:本文中的javafx.util.Pair.getValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。