| new Properties() | ใช้สร้าง object Properties |
|---|---|
| put() | ใช้เพิ่มข้อมูลเข้าไปใน Properties |
| clear() | ใช้ลบข้อมูลทั้งหมดที่มีใน Properties |
| remove() | ใช้ลบข้อมูลออกจาก Properties |
| getProperties() | ใช้คืนค่า value จาก Properties ที่มี key ตามที่กำหนด |
| containsKey() | ใช้ตรวจสอบว่ามี key ที่กำหนดอยู่ใน Properties หรือไม่ |
| containsValue() | ใช้ตรวจสอบว่ามี value ที่กำหนดอยู่ใน Properties หรือไม่ |
| contains() | ใช้ตรวจสอบว่ามี key หรือ value ที่กำหนดอยู่ใน Properties หรือไม่ |
| propertyNames() | ใช้คืนค่า key ทั้งหมดที่มีใน Properties |
| size() | ใช้คืนค่า จำนวนข้อมูลทั้งหมด ที่มีใน Properties |
| isEmpty() | ใช้ตรวจสอบว่า Properties ไม่มีข้อมูลอยู่เลย ใช่หรือไม่ |
method:new Properties ();
return type:Properties
content:ใช้สร้าง object Properties
example:Properties properties = new Properties ();
method:put ( object_string_key, object_string_value );
return type:void
content:ใช้เพิ่มข้อมูลเข้าไปใน Properties
example:Properties properties = new Properties (); properties.put ( "bamboo", "ไม้ไผ่" );
method:clear ();
return type:void
content:ใช้ลบข้อมูลทั้งหมดที่มีใน Properties
example:Properties properties = new Properties (); properties.put ( "bamboo", "ไม้ไผ่" ); properties.put ( "lab", "ห้องปฏิบัติการ" ); properties.put ( "code", "รหัส" ); properties.clear ();
method:remove ( object_string_key );
return type:void
content:ใช้ลบข้อมูลออกจาก Properties
example:Properties properties = new Properties (); properties.put ( "bamboo", "ไม้ไผ่" ); properties.put ( "lab", "ห้องปฏิบัติการ" ); properties.put ( "code", "รหัส" ); properties.remove ( "lab" );
method:getProperties ( object_string_key );
return type:Object
content:ใช้คืนค่า value จาก Properties ที่มี key ตามที่กำหนด
example:Properties properties = new Properties (); properties.put ( "bamboo", "ไม้ไผ่" ); properties.put ( "lab", "ห้องปฏิบัติการ" ); properties.put ( "code", "รหัส" ); System.out.println ( properties.get ( "bamboo" ) );
method:containsKey ( object_string_key );
return type:boolean
content:ใช้ตรวจสอบว่ามี key ที่กำหนดอยู่ใน Properties หรือไม่
example:Properties properties = new Properties (); properties.put ( "bamboo", "ไม้ไผ่" ); properties.put ( "lab", "ห้องปฏิบัติการ" ); properties.put ( "code", "รหัส" ); if ( properties.containsKey ( "bamboo" ) ) { System.out.println ( "bamboo is in Properties." ); }
method:containsValue ( object_string_value );
return type:boolean
content:ใช้ตรวจสอบว่ามี value ที่กำหนดอยู่ใน Properties หรือไม่
example:Properties properties = new Properties (); properties.put ( "bamboo", "ไม้ไผ่" ); properties.put ( "lab", "ห้องปฏิบัติการ" ); properties.put ( "code", "รหัส" ); if ( properties.containsValue ( "ไม้ไผ่" ) ) { System.out.println ( "ไม้ไผ่ is in Properties." ); }
method:contains ( object_string );
return type:boolean
content:ใช้ตรวจสอบว่ามี key หรือ value ที่กำหนดอยู่ใน Properties หรือไม่
example:Properties properties = new Properties (); properties.put ( "bamboo", "ไม้ไผ่" ); properties.put ( "lab", "ห้องปฏิบัติการ" ); properties.put ( "code", "รหัส" ); if ( properties.contains ( "ไม้ไผ่" ) ) { System.out.println ( "ไม้ไผ่ is in Properties." ); }
method:propertyNames ();
return type:Enumeration
content:ใช้คืนค่า key ทั้งหมดที่มีใน Properties
example:Properties properties = new Properties (); properties.put ( "bamboo", "ไม้ไผ่" ); properties.put ( "lab", "ห้องปฏิบัติการ" ); properties.put ( "code", "รหัส" ); Enumeration enumeration = properties.propertyNames ();
method:size ();
return type:int
content:ใช้คืนค่า จำนวนข้อมูลทั้งหมด ที่มีใน Properties
example:Properties properties = new Properties (); properties.put ( "bamboo", "ไม้ไผ่" ); properties.put ( "lab", "ห้องปฏิบัติการ" ); properties.put ( "code", "รหัส" ); int size = properties.size ();
method:isEmpty ();
return type:boolean
content:ใช้ตรวจสอบว่า Properties ไม่มีข้อมูลอยู่เลย ใช่หรือไม่
example:Properties properties = new Properties (); if ( properties.isEmpty () ) { System.out.println ( "Properties is empty" ); }