Example usage for java.util SortedMap lastKey

List of usage examples for java.util SortedMap lastKey

Introduction

In this page you can find the example usage for java.util SortedMap lastKey.

Prototype

K lastKey();

Source Link

Document

Returns the last (highest) key currently in this map.

Usage

From source file:de.ingrid.admin.controller.GeneralController.java

private String toJsonMap(final SortedMap<String, List<Provider>> map) {
    final StringBuilder result = new StringBuilder("{");
    for (final String key : map.keySet()) {
        result.append("'" + key + "':[");
        final Iterator<Provider> it = map.get(key).iterator();
        while (it.hasNext()) {
            final Provider p = it.next();
            result.append(/*from   ww w.jav  a2s  . c  o m*/
                    "{'shortName':'" + p.getShortName() + "','displayName':'" + p.getDisplayName() + "'}");
            if (it.hasNext()) {
                result.append(",");
            }
        }
        result.append("]");
        if (key != map.lastKey()) {
            result.append(",");
        }
    }
    result.append("}");
    return result.toString();
}

From source file:edu.umd.cfar.lamp.viper.util.Range.java

/**
 * Checks to see if the interval defined as [s,e)
 * is entirely contained within this Range object.
 * //from  w w  w  . ja  v a  2 s. c o m
 * @param s
 * @param e
 * @return boolean
 */
public boolean withinRange(Comparable s, Comparable e) {
    SortedMap m = spans.headMap(e);
    if (!m.isEmpty()) {
        // thankfully Range keeps contiguous spans merged,
        // so this is easy
        Comparable start = (Comparable) m.lastKey();
        Comparable end = (Comparable) m.get(start);
        if (end.compareTo(s) >= 0) {
            return start.compareTo(s) <= 0 && end.compareTo(e) >= 0;
        }
    }
    m = spans.tailMap(s);
    if (!m.isEmpty()) {
        Comparable sPrime = (Comparable) m.firstKey();
        if (sPrime.compareTo(s) == 0) {
            return e.compareTo((Comparable) m.get(sPrime)) <= 0;
        }
    }
    return false;
}

From source file:org.gvnix.web.screen.roo.addon.RelatedPatternMetadataProvider.java

/**
 * Get master entity.// www  .  j a  v a 2s  .c  om
 * 
 * @param entity Current entity (entity placed into detail on pattern)
 * @param relatedEntities Related entities
 * @return Master entity
 */
protected JavaType getMasterEntity(JavaType entity,
        SortedMap<JavaType, JavaTypeMetadataDetails> relatedEntities) {

    try {

        // The other related entity is the master entity
        // TODO Can be more related entities besides master entity
        SortedMap<JavaType, JavaTypeMetadataDetails> tempMap = new TreeMap<JavaType, JavaTypeMetadataDetails>(
                relatedEntities);
        tempMap.remove(entity);

        ClassOrInterfaceTypeDetails cid = null;

        Set<JavaType> keySet = tempMap.keySet();
        Iterator<JavaType> it = keySet.iterator();
        while (it.hasNext()) {
            JavaType type = it.next();
            cid = getTypeLocationService().getTypeDetails(type);
            if (!cid.getEnumConstants().isEmpty()) {
                tempMap.remove(type);
            }
        }

        return tempMap.lastKey();

    } catch (NoSuchElementException e) {
        LOGGER.fine(String.format("Related pattern without master entity (%s)", entity));
        // This is a related pattern without master entity. Is this possible
        // ?
    }

    return null;
}

From source file:edu.umd.cfar.lamp.viper.util.Range.java

/**
 * Checks to see if some interval of this
 * intersects the specified interval.//from w  w  w  .java 2s . c  om
 * @param s the interval to test against
 * @return <code>true</code> if there is some overlap
 */
public boolean intersects(Interval s) {
    if (this.isEmpty() || s.isEmpty()) {
        return false;
    }
    SortedMap m = spans.subMap(s.getStart(), s.getEnd());
    if (!m.isEmpty()) {
        return true;
    } else {
        m = spans.headMap(s.getStart());
        Interval last = (Interval) m.get(m.lastKey());
        return last.intersects(s);
    }
}

From source file:com.illustrationfinder.process.post.HtmlPostProcessor.java

@Override
public List<String> generateKeywords() {
    // TODO If two words are always close to each other, they should be considered as an expression and managed like one word
    if (this.url == null)
        return null;

    try {/* ww  w .  j a va  2 s  .c  o  m*/
        // Retrieve the document and store it temporary
        try (final InputStream stream = this.url.openStream()) {
            final String rawText = IOUtils.toString(stream);

            // Retrieve useful HTML data
            final Document document = Jsoup.parse(rawText);

            String htmlTitle = document.title();
            String htmlKeywords = document.select("meta[name=keywords]").text();
            String htmlDescription = document.select("meta[name=description]").text();

            // Extract the content of the raw text
            String content = ArticleExtractor.getInstance().getText(rawText);

            // Now we apply a simple algorithm to get keywords
            //  1) We remove all punctuation marks from the title
            //  2) We remove all words with less than 4 characters
            //  3) We remove excessive spacing and tabulations

            htmlTitle = htmlTitle.toLowerCase();
            htmlTitle = htmlTitle.replaceAll(PUNCTUATION_REGEX, "");
            htmlTitle = htmlTitle.replaceAll(WORD_WITH_LESS_THAN_4_CHARACTERS_REGEX, "");
            htmlTitle = htmlTitle.replaceAll(EXCESSIVE_SPACING_REGEX, " ");

            final List<String> keywords = new ArrayList<>();
            final List<String> keywordsList = Arrays.asList(htmlTitle.split(" "));
            for (String tmp : keywordsList) {
                if (tmp.length() >= MINIMUM_WORD_LENGTH) {
                    keywords.add(tmp);
                }
            }

            // If there is enough keywords, we return
            if (keywords.size() >= MINIMUM_KEYWORDS_COUNT) {
                return keywords;
            } else {
                // Otherwise, we look for more keywords from the text by taking the more frequent words
                content = content.toLowerCase();
                content = content.replaceAll(PUNCTUATION_REGEX, "");
                content = content.replaceAll(WORD_WITH_LESS_THAN_4_CHARACTERS_REGEX, "");
                content = content.replaceAll(EXCESSIVE_SPACING_REGEX, " ");

                final Map<String, Integer> frequencies = new HashMap<>();
                final String[] words = content.split(" ");

                // Count word frequencies
                for (final String word : words) {
                    if (frequencies.containsKey(word)) {
                        frequencies.put(word, frequencies.get(word) + 1);
                    } else {
                        frequencies.put(word, 1);
                    }
                }

                // Sort the words per frequency
                final SortedMap<Integer, HashSet<String>> sortedWords = new TreeMap<>();

                for (Map.Entry<String, Integer> entry : frequencies.entrySet()) {
                    if (sortedWords.containsKey(entry.getValue())) {
                        sortedWords.get(entry.getValue()).add(entry.getKey());
                    } else {
                        final HashSet<String> set = new HashSet<>();
                        set.add(entry.getKey());
                        sortedWords.put(entry.getValue(), set);
                    }
                }

                // Add the most frequent words until we reach the minimu keywords count
                while (keywords.size() < MINIMUM_KEYWORDS_COUNT) {
                    final HashSet<String> set = sortedWords.get(sortedWords.lastKey());
                    final String keyword = set.iterator().next();

                    set.remove(keyword);
                    if (set.size() == 0) {
                        sortedWords.remove(sortedWords.lastKey());
                    }

                    if (keyword.length() > MINIMUM_WORD_LENGTH) {
                        keywords.add(keyword);
                    }
                }

                return keywords;
            }
        }
    } catch (BoilerpipeProcessingException e) {
        // TODO
        e.printStackTrace();
    } catch (IOException e) {
        // TODO
        e.printStackTrace();
    }

    return null;
}

From source file:org.apache.cassandra.index.sasi.disk.TokenTreeTest.java

public void skipPastEnd(TokenTreeBuilder builder, SortedMap<Long, LongSet> tokens) throws Exception {
    builder.finish();//from  w  ww.  j  av  a2s.  co m
    final File treeFile = File.createTempFile("token-tree-skip-past-test", "tt");
    treeFile.deleteOnExit();

    try (SequentialWriter writer = new SequentialWriter(treeFile, 4096, BufferType.ON_HEAP)) {
        builder.write(writer);
        writer.sync();
    }

    final RandomAccessReader reader = RandomAccessReader.open(treeFile);
    final RangeIterator<Long, Token> tokenTree = new TokenTree(new MappedBuffer(reader))
            .iterator(KEY_CONVERTER);

    tokenTree.skipTo(tokens.lastKey() + 10);
}

From source file:org.onebusaway.admin.service.bundle.hastus.HastusGtfsFactory.java

private void processStopTimesForTrip(Map<String, Integer> timepointPositions, PttTrip pttTrip, String tripIdRaw,
        RouteStopSequence stopSequence, Trip trip) throws ParseException {

    SortedMap<Integer, Integer> arrivalTimesByTimepointPosition = computeTimepointPositionToScheduleTimep(
            pttTrip);//from  w w w.j a  va 2 s  .co m

    if (arrivalTimesByTimepointPosition.size() < 2) {
        _log.warn("less than two timepoints specified for trip: id=" + trip.getId());
        return;
    }

    int firstTimepointPosition = arrivalTimesByTimepointPosition.firstKey();
    int lastTimepointPosition = arrivalTimesByTimepointPosition.lastKey();

    int firstStopIndex = Integer.MAX_VALUE;
    int lastStopIndex = Integer.MIN_VALUE;

    /**
     * Find the bounds on the set of stops that have stop times defined
     */
    List<RouteStopSequenceItem> items = stopSequence.getItems();

    for (int index = 0; index < items.size(); index++) {
        RouteStopSequenceItem item = items.get(index);
        Integer time = getScheduledTimeForTimepoint(item, timepointPositions, arrivalTimesByTimepointPosition);

        if (time != null) {
            firstStopIndex = Math.min(firstStopIndex, index);
            lastStopIndex = Math.max(lastStopIndex, index);
        }
    }

    StopTime first = null;
    StopTime last = null;

    for (int index = firstStopIndex; index < lastStopIndex + 1; index++) {
        RouteStopSequenceItem item = items.get(index);

        Integer time = getScheduledTimeForTimepoint(item, timepointPositions, arrivalTimesByTimepointPosition);
        Stop stop = _dao.getStopForId(id(Long.toString(item.getStopId())));

        StopTime stopTime = new StopTime();
        stopTime.setStop(stop);
        stopTime.setStopSequence(index - firstStopIndex);
        stopTime.setTrip(trip);

        if ("N".equals(item.getBoarding())) {
            // timepoint -- not for pickup/drop off
            stopTime.setDropOffType(1);
            stopTime.setPickupType(1);
            _timepointIds.add(id(Long.toString(item.getStopId())));
        } else if ("A".equals(item.getBoarding())) {
            stopTime.setDropOffType(0);
            stopTime.setPickupType(1);
        } else if ("B".equals(item.getBoarding())) {
            stopTime.setDropOffType(1);
            stopTime.setPickupType(0);
        } else if ("E".equals(item.getBoarding())) {
            stopTime.setDropOffType(0);
            stopTime.setPickupType(0);
        } //else we don't set it, it defaults

        if (time != null) {
            stopTime.setArrivalTime(time);
            stopTime.setDepartureTime(time);
        }
        if (!"N".equals(item.getBoarding())) {
            // if we are a timepoint, don't bother adding the stop to the GTFS
            _dao.saveEntity(stopTime);
        } else {
            _log.info("skipping stop " + item.getStopId() + " on trip " + trip.getId().getId()
                    + " as it has no boarding");
            stopTime = null;
        }

        if (first == null)
            first = stopTime;
        last = stopTime;
    }

    if (!first.isDepartureTimeSet()) {
        _log.warn("departure time for first StopTime is not set: stop=" + first.getStop().getId() + " trip="
                + tripIdRaw + " firstPosition=" + firstTimepointPosition + " lastPosition="
                + lastTimepointPosition);
        for (RouteStopSequenceItem item : stopSequence)
            _log.warn("  stop=" + item.getStopId() + " timepoint=" + item.getTimePoint() + " pos="
                    + timepointPositions.get(item.getTimePoint()));
    }

    if (!last.isArrivalTimeSet()) {
        _log.warn("arrival time for last StopTime is not set: stop=" + last.getStop().getId() + " trip="
                + tripIdRaw + " firstPosition=" + firstTimepointPosition + " lastPosition="
                + lastTimepointPosition);
        for (RouteStopSequenceItem item : stopSequence)
            _log.warn("  stop=" + item.getStopId() + " timepoint=" + item.getTimePoint() + " pos="
                    + timepointPositions.get(item.getTimePoint()));
    }
}

From source file:cerrla.LocalCrossEntropyDistribution.java

/**
 * Generates a policy from the current distribution.
 * /*from  www .  jav  a  2  s.  c  o  m*/
 * @param existingSubGoals
 *            A collection of all existing sub-goals in the parent policy
 *            this policy is to be put into.
 * @return A newly generated policy from the current distribution.
 */
public ModularPolicy generatePolicy(Collection<ModularPolicy> existingSubGoals) {
    // If testing greedy policies
    if (Config.getInstance().getGeneratorFile() != null) {
        if (bestPolicy_ == null || testEpisode_ >= ProgramArgument.TEST_ITERATIONS.intValue()) {
            SortedMap<Integer, RelationalPolicy> greedyPolicies = policyGenerator_.getGreedyPolicyMap();
            SortedMap<Integer, RelationalPolicy> nextKey = greedyPolicies.tailMap(currentEpisode_ + 1);

            if (ProgramArgument.TESTING.booleanValue()) {
                currentEpisode_ = greedyPolicies.lastKey();
                bestPolicy_ = new ModularPolicy(greedyPolicies.get(currentEpisode_), this);
                testEpisode_ = 0;
            } else if (nextKey == null || nextKey.isEmpty()) {
                // End of testing. Exit.
                bestPolicyEpisode_ = ProgramArgument.TEST_ITERATIONS.intValue();
            } else {
                // Next policy and next episode.
                currentEpisode_ = nextKey.firstKey();
                bestPolicy_ = new ModularPolicy(greedyPolicies.get(currentEpisode_), this);
                testEpisode_ = 0;
            }
        }

        bestPolicy_.clearPolicyRewards();
        return bestPolicy_;
    }

    if (frozen_ && state_ == AlgorithmState.BEST_POLICY) {
        bestPolicy_.clearPolicyRewards();
        return bestPolicy_;
    }

    // Initialise undertested
    if (undertestedPolicies_ == null)
        undertestedPolicies_ = new LinkedList<ModularPolicy>();

    // If there remains an undertested policy not already in the parent
    // policy, use that
    for (Iterator<ModularPolicy> iter = undertestedPolicies_.iterator(); iter.hasNext();) {
        ModularPolicy undertested = iter.next();
        if (undertested.shouldRegenerate() || !isValidSample(undertested, false))
            // If the element is fully tested, remove it.
            iter.remove();
        else if (!existingSubGoals.contains(undertested)) {
            // If the parent policy doesn't already contain the undertested
            // policy, return it.
            undertested.clearChildren();
            return undertested;
        }
    }

    // Otherwise generate a new policy
    RelationalPolicy newPol = policyGenerator_.generatePolicy(true, false);
    ModularPolicy newModPol = null;
    if (newPol instanceof ModularPolicy)
        newModPol = new ModularPolicy((ModularPolicy) newPol);
    else
        newModPol = new ModularPolicy(newPol, this);
    undertestedPolicies_.add(newModPol);
    return newModPol;
}

From source file:org.jahia.modules.modulemanager.forge.ForgeService.java

public List<Module> loadModules() {
    if (flushModules || (lastModulesLoad + loadModulesDelay) < new Date().getTime()) {
        modules.clear();/* w w w. ja  v a  2s.c o  m*/
        for (Forge forge : forges) {
            String url = forge.getUrl() + "/contents/modules-repository.moduleList.json";
            Map<String, String> headers = new HashMap<String, String>();
            if (!StringUtils.isEmpty(forge.getUser())) {
                headers.put("Authorization",
                        "Basic " + Base64.encode((forge.getUser() + ":" + forge.getPassword()).getBytes()));
            }
            headers.put("accept", "application/json");

            String jsonModuleList = httpClientService.executeGet(url, headers);
            try {
                JSONArray modulesRoot = new JSONArray(jsonModuleList);

                JSONArray moduleList = modulesRoot.getJSONObject(0).getJSONArray("modules");
                for (int i = 0; i < moduleList.length(); i++) {
                    boolean add = true;

                    final JSONObject moduleObject = moduleList.getJSONObject(i);
                    for (Module m : modules) {
                        if (StringUtils.equals(m.getId(), moduleObject.getString("name"))
                                && StringUtils.equals(m.getGroupId(), moduleObject.getString("groupId"))) {
                            add = false;
                            break;
                        }
                    }
                    if (add) {
                        final JSONArray moduleVersions = moduleObject.getJSONArray("versions");

                        SortedMap<Version, JSONObject> sortedVersions = new TreeMap<Version, JSONObject>();

                        final Version jahiaVersion = new Version(Jahia.VERSION);

                        for (int j = 0; j < moduleVersions.length(); j++) {
                            JSONObject object = moduleVersions.getJSONObject(j);
                            Version version = new Version(object.getString("version"));
                            Version requiredVersion = new Version(StringUtils
                                    .substringAfter(object.getString("requiredVersion"), "version-"));
                            if (requiredVersion.compareTo(jahiaVersion) <= 0) {
                                sortedVersions.put(version, object);
                            }
                        }
                        if (!sortedVersions.isEmpty()) {
                            Module module = new Module();
                            JSONObject versionObject = sortedVersions.get(sortedVersions.lastKey());
                            module.setRemoteUrl(moduleObject.getString("remoteUrl"));
                            module.setRemotePath(moduleObject.getString("path"));
                            if (moduleObject.has("icon")) {
                                module.setIcon(moduleObject.getString("icon"));
                            }
                            module.setVersion(versionObject.getString("version"));
                            module.setName(moduleObject.getString("title"));
                            module.setId(moduleObject.getString("name"));
                            module.setGroupId(moduleObject.getString("groupId"));
                            module.setDownloadUrl(versionObject.getString("downloadUrl"));
                            module.setForgeId(forge.getId());
                            modules.add(module);
                        }
                    }
                }
            } catch (JSONException e) {
                logger.error("unable to parse JSON return string for " + url);
            } catch (Exception e) {
                logger.error("unable to get store information" + e.getMessage());
            }
        }
        Collections.sort(modules);
        lastModulesLoad = new Date().getTime();
        flushModules = false;
    }

    return modules;
}

From source file:okuyama.imdst.util.DataDispatcher.java

/**
 * ConsitentHash??????.<br>/*from   w ww  .j  av a  2  s. c o  m*/
 * ??????????????????keyNodeMap?<br>
 * "oldNodeCircle"????????.<br>
 * ??????????????Hash??????<br>
 * FullName???HashMap????.<br>
 * ???HashMap?"main"??????"sub"???????"third"?????Map?????.<br>
 * ???"tomain"??????"tosub"??????"tothird"????????.<br>
 *
 * @param keyNodeFullName ? "192.168.1.3:5555"
 * @param subKeyNodeFullName ? "192.168.2.3:5555"
 * @param thirdKeyNodeFullName ? "192.168.2.3:5555"
 * @return HashMap ?
 */
public static HashMap addNode4ConsistentHash(String keyNodeFullName, String subKeyNodeFullName,
        String thirdKeyNodeFullName) {
    if (oldCircle != null)
        return null;
    HashMap retMap = new HashMap(2);
    HashMap convertMap = new HashMap();
    HashMap subConvertMap = new HashMap();
    HashMap thirdConvertMap = new HashMap();
    ArrayList keyNodeList = new ArrayList();
    ArrayList subKeyNodeList = new ArrayList();
    ArrayList thirdKeyNodeList = new ArrayList();

    oldCircle = new TreeMap();

    // ????
    Set set = nodeCircle.keySet();
    Iterator iterator = set.iterator();

    // oldCircle?
    while (iterator.hasNext()) {
        Integer key = (Integer) iterator.next();
        String nodeFullName = (String) nodeCircle.get(key);
        oldCircle.put(key, nodeFullName);
    }

    // ?
    convertMap = new HashMap();

    for (int i = 0; i < virtualNodeSize; i++) {

        int targetHash = sha1Hash4Int(keyNodeFullName + "_" + i);
        int targetHashStart = 0;
        int targetHashEnd = targetHash;
        String nodeName = null;

        SortedMap headMap = nodeCircle.headMap(targetHash);
        SortedMap tailMap = nodeCircle.tailMap(targetHash);

        // ???????????????
        // ?????1?????????
        // ????????????
        // ????Node01,Node02,Node03???Node04?????
        // Node01?511112430???Node02?45676987654??
        if (headMap.isEmpty()) {

            int hash = ((Integer) nodeCircle.lastKey()).intValue();
            targetHashStart = hash + 1;
            nodeName = (String) nodeCircle.get(nodeCircle.firstKey());
        } else {

            int hash = ((Integer) headMap.lastKey()).intValue();
            targetHashStart = hash + 1;
            if (tailMap.isEmpty()) {

                nodeName = (String) nodeCircle.get(nodeCircle.firstKey());
            } else {

                nodeName = (String) nodeCircle.get(tailMap.firstKey());
            }
        }

        // ???????????
        // _??
        // Node01:5553,"6756-9876_12345-987654"
        // Node02:5553,"342-3456_156456-178755"
        if (convertMap.containsKey(nodeName)) {

            String work = (String) convertMap.get(nodeName);
            convertMap.put(nodeName, work + "_" + targetHashStart + "-" + targetHashEnd);

            // 
            String[] subDataNodeInfo = (String[]) keyNodeMap.get(nodeName + "_sub");
            if (subDataNodeInfo != null) {
                subConvertMap.put(subDataNodeInfo[2], work + "_" + targetHashStart + "-" + targetHashEnd);
            }

            // 
            String[] thirdDataNodeInfo = (String[]) keyNodeMap.get(nodeName + "_third");
            if (thirdDataNodeInfo != null) {
                thirdConvertMap.put(thirdDataNodeInfo[2], work + "_" + targetHashStart + "-" + targetHashEnd);
            }

        } else {

            convertMap.put(nodeName, targetHashStart + "-" + targetHashEnd);

            // 
            String[] subDataNodeInfo = (String[]) keyNodeMap.get(nodeName + "_sub");
            if (subDataNodeInfo != null) {
                subConvertMap.put(subDataNodeInfo[2], targetHashStart + "-" + targetHashEnd);
            }

            // 
            String[] thirdDataNodeInfo = (String[]) keyNodeMap.get(nodeName + "_third");
            if (thirdDataNodeInfo != null) {
                thirdConvertMap.put(thirdDataNodeInfo[2], targetHashStart + "-" + targetHashEnd);
            }

        }
    }

    // ???Map?
    retMap.put("tomain", keyNodeFullName);
    retMap.put("tosub", subKeyNodeFullName);
    retMap.put("tothird", thirdKeyNodeFullName);
    retMap.put("main", convertMap);
    retMap.put("sub", subConvertMap);
    retMap.put("third", thirdConvertMap);

    // ???
    // ??
    // [0][*]=Name
    // [1][*]=Port
    // [2][*]=Full
    // [3][*]=Name
    // [4][*]=Port
    // [5][*]=Full
    // [6][*]=Name
    // [7][*]=Port
    // [8][*]=Full
    String[][] allNodeDetailList = (String[][]) keyNodeMap.get("list");
    String[][] newAllNodeDetailList = new String[9][allNodeDetailList.length + 1];
    keyNodeList = (ArrayList) allNodeMap.get("main");

    // allNodeDetailList??????
    for (int allNodeDetailListIdx = 0; allNodeDetailListIdx < allNodeDetailList[0].length; allNodeDetailListIdx++) {

        newAllNodeDetailList[0][allNodeDetailListIdx] = allNodeDetailList[0][allNodeDetailListIdx];
        newAllNodeDetailList[1][allNodeDetailListIdx] = allNodeDetailList[1][allNodeDetailListIdx];
        newAllNodeDetailList[2][allNodeDetailListIdx] = allNodeDetailList[2][allNodeDetailListIdx];
        newAllNodeDetailList[3][allNodeDetailListIdx] = allNodeDetailList[3][allNodeDetailListIdx];
        newAllNodeDetailList[4][allNodeDetailListIdx] = allNodeDetailList[4][allNodeDetailListIdx];
        newAllNodeDetailList[5][allNodeDetailListIdx] = allNodeDetailList[5][allNodeDetailListIdx];
        newAllNodeDetailList[6][allNodeDetailListIdx] = allNodeDetailList[6][allNodeDetailListIdx];
        newAllNodeDetailList[7][allNodeDetailListIdx] = allNodeDetailList[7][allNodeDetailListIdx];
        newAllNodeDetailList[8][allNodeDetailListIdx] = allNodeDetailList[8][allNodeDetailListIdx];
    }

    String keyNode = keyNodeFullName;
    String[] keyNodeDt = keyNode.split(":");
    keyNodeList.add(keyNode);

    // ??allNodeDetailList?
    newAllNodeDetailList[2][allNodeDetailList.length] = keyNode;
    newAllNodeDetailList[0][allNodeDetailList.length] = keyNodeDt[0];
    newAllNodeDetailList[1][allNodeDetailList.length] = keyNodeDt[1];
    String[] mainNodeDt = { keyNodeDt[0], keyNodeDt[1], keyNode };

    // keyNodeMap?
    keyNodeMap.put(keyNode, mainNodeDt);

    // ConsistentHash??
    for (int i = 0; i < virtualNodeSize; i++) {

        // FullName???????????Hash???Circle?
        // KeyNode??
        // ??keyNodeMap?????
        nodeCircle.put(new Integer(sha1Hash4Int(keyNode + "_" + i)), keyNode);
    }

    synchronized (syncObj) {
        allNodeMap.put("main", keyNodeList);
    }

    // SubNode?
    if (subKeyNodeFullName != null && !subKeyNodeFullName.equals("")) {
        String subKeyNode = subKeyNodeFullName;
        String[] subKeyNodeDt = subKeyNode.split(":");
        subKeyNodeList = (ArrayList) allNodeMap.put("sub", subKeyNodeList);

        subKeyNodeList.add(subKeyNode);

        newAllNodeDetailList[5][allNodeDetailList.length] = subKeyNode;
        newAllNodeDetailList[3][allNodeDetailList.length] = subKeyNodeDt[0];
        newAllNodeDetailList[4][allNodeDetailList.length] = subKeyNodeDt[1];
        String[] subNodeDt = { subKeyNodeDt[0], subKeyNodeDt[1], subKeyNode };

        keyNodeMap.put(newAllNodeDetailList[2][allNodeDetailList.length] + "_sub", subNodeDt);

        synchronized (syncObj) {
            allNodeMap.put("sub", subKeyNodeList);
        }
    }

    // ThirdNode?
    if (thirdKeyNodeFullName != null && !thirdKeyNodeFullName.equals("")) {
        String thirdKeyNode = thirdKeyNodeFullName;
        String[] thirdKeyNodeDt = thirdKeyNode.split(":");
        thirdKeyNodeList = (ArrayList) allNodeMap.put("third", thirdKeyNodeList);

        thirdKeyNodeList.add(thirdKeyNode);

        newAllNodeDetailList[8][allNodeDetailList.length] = thirdKeyNode;
        newAllNodeDetailList[6][allNodeDetailList.length] = thirdKeyNodeDt[0];
        newAllNodeDetailList[7][allNodeDetailList.length] = thirdKeyNodeDt[1];
        String[] thirdNodeDt = { thirdKeyNodeDt[0], thirdKeyNodeDt[1], thirdKeyNode };

        keyNodeMap.put(newAllNodeDetailList[2][allNodeDetailList.length] + "_third", thirdNodeDt);

        synchronized (syncObj) {
            allNodeMap.put("third", thirdKeyNodeList);
        }
    }

    // ????
    keyNodeMap.put("list", newAllNodeDetailList);

    return retMap;
}