当前位置: 首页>>代码示例>>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;未经允许,请勿转载。