Package ch.ivyteam.ivy.scripting.objects
Class Record
java.lang.Object
ch.ivyteam.ivy.scripting.objects.NestedObject
ch.ivyteam.ivy.scripting.objects.Record
- All Implemented Interfaces:
IIvyDataObject
,Serializable
,Cloneable
Records are rows in DB tables.
- See Also:
- API:
- This is a public API.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones this record (shallow copy).Clones this record (deep copy).Retuns the value of a given field.int
getFieldIndex
(String keyStr) Computes the index of a field.getKeys()
Returns (a copy of) the keys of this Record.Returns (a copy of) the values of this Record.boolean
isEmpty()
Tests whether the record is empty.void
Set the value of a field.int
size()
Returns the size of this recordset.Methods inherited from class ch.ivyteam.ivy.scripting.objects.NestedObject
equals, hashCode, toString
-
Constructor Details
-
Record
public Record()Creates an empty uninitialized record.- API:
- This public API is available in Java.
-
Record
Creates a new Record with given initial values.- Parameters:
_keys
- The keys of the record._values
- The values of the record. The parameter list must be of the same size.- API:
- This public API is available in Java.
-
Record
Creates a new Record with given initial values.- Parameters:
_keys
- The keys of the record._values
- The values of the record. The parameter list must be of the same size.- API:
- This public API is available in Java.
-
-
Method Details
-
getField
Retuns the value of a given field.- Parameters:
key
- The name of the field.- Returns:
- The value of the field.
- API:
- This public API is available in Java.
-
putField
Set the value of a field. If already a filed of this name exists, the value of this field is overwritten; otherwise, a new field is created in this record. The search for a key is not case-sensitive.- Parameters:
key
- The key of a field.value
- The new value of the field.- API:
- This public API is available in Java.
-
getKeys
Returns (a copy of) the keys of this Record.- Returns:
- A List with keys.
- API:
- This public API is available in Java.
-
getValues
Returns (a copy of) the values of this Record.- Returns:
- A List with values.
- API:
- This public API is available in Java.
-
getFieldIndex
Computes the index of a field. The search is not case-sensitive.- Parameters:
keyStr
- the key whose value you want- Returns:
- index of the field if the field is not found -1
- API:
- This public API is available in Java.
-
size
public int size()Returns the size of this recordset.- Returns:
- The size of this recordset.
- API:
- This public API is available in Java.
-
isEmpty
public boolean isEmpty()Tests whether the record is empty.- Returns:
- True if this record is empty.
- API:
- This public API is available in Java.
-
clone
Clones this record (shallow copy).- Specified by:
clone
in interfaceIIvyDataObject
- Overrides:
clone
in classNestedObject
- Returns:
- A shallow of this object.
- See Also:
- API:
- This public API is available in Java.
-
deepClone
Clones this record (deep copy).- Specified by:
deepClone
in interfaceIIvyDataObject
- Overrides:
deepClone
in classNestedObject
- Returns:
- A deep of this object.
- API:
- This public API is available in Java.
-