按一下以給予評分及指教
MSDN
MSDN Library
Visual J#
Visual J# 參考
java.util
TreeMap Class
TreeMap Methods
 headMap Method
全部折疊/全部展開 全部折疊
Visual J# Reference
TreeMap.headMap Method

Retrieves a part of the map whose keys are less than a specific key value.

Package: java.util

Assembly: vjslib (in vjslib.dll)

public java.util.SortedMap headMap(
    java.lang.Object toV);

Parameters

toV

The highest key value.

A part of the map whose keys are less than toV.

In this example, you create and initialize a TreeMap object, and then you display the elements of headMap.

// TreeMap-headm1.jsl
// TreeMap.headMap example

import java.util.*;

public class MyClass
{
    public static void main(String[] args)
    {
        // Create a TreeMap object:
        TreeMap tm = new TreeMap();

        // Add some elements:
        tm.put("1","Sally Abolrous");
        tm.put("3","Craig Combel");
        tm.put("5","Pille Mandla");

        // Display the headMap:
        System.out.println("The head map is:\n" + tm.headMap("5"));
    }
}

/*
Output:
The head map is:
{1=Sally Abolrous, 3=Craig Combel}
*/
社群內容   什麼是社群內容?
新增內容 RSS  註解
Processing
© 2009 Microsoft Corporation. 著作權所有,並保留一切權利。 使用規定 | 商標 | 隱私權聲明
Page view tracker