summaryrefslogtreecommitdiffstats
path: root/vespajlib/src/main/java/com/yahoo/slime/Cursor.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/slime/Cursor.java')
-rw-r--r--vespajlib/src/main/java/com/yahoo/slime/Cursor.java250
1 files changed, 139 insertions, 111 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/slime/Cursor.java b/vespajlib/src/main/java/com/yahoo/slime/Cursor.java
index 2696e923bd5..e6493a2ba4c 100644
--- a/vespajlib/src/main/java/com/yahoo/slime/Cursor.java
+++ b/vespajlib/src/main/java/com/yahoo/slime/Cursor.java
@@ -16,270 +16,298 @@ package com.yahoo.slime;
* not connected to an array value (for add methods), or it's not
* connected to an object (for set methods). Also note that you can
* only set() a field once; you cannot overwrite the field in any way.
- **/
+ *
+ * @author havardpe
+ */
public interface Cursor extends Inspector {
/**
- * Access an array entry.
+ * Accesses an array entry.
*
* If the current Cursor doesn't connect to an array value,
* or the given array index is out of bounds, the returned
* Cursor will be invalid.
- * @param idx array index.
- * @return a new Cursor for the entry value.
- **/
+ *
+ * @param idx array index
+ * @return a new Cursor for the entry value
+ */
@Override
- public Cursor entry(int idx);
+ Cursor entry(int idx);
/**
- * Access an field in an object by symbol id.
+ * Accesses a field in an object by symbol id.
*
* If the current Cursor doesn't connect to an object value, or
* the object value does not contain a field with the given symbol
* id, the returned Cursor will be invalid.
- * @param sym symbol id.
- * @return a new Cursor for the field value.
- **/
+ *
+ * @param sym symbol id
+ * @return a new Cursor for the field value
+ */
@Override
- public Cursor field(int sym);
+ Cursor field(int sym);
/**
- * Access an field in an object by symbol name.
+ * Accesses a field in an object by symbol name.
*
* If the current Cursor doesn't connect to an object value, or
* the object value does not contain a field with the given symbol
* name, the returned Cursor will be invalid.
- * @param name symbol name.
- * @return a new Cursor for the field value.
- **/
+ *
+ * @param name symbol name
+ * @return a new Cursor for the field value
+ */
@Override
- public Cursor field(String name);
+ Cursor field(String name);
/**
- * Append an array entry containing a new value of NIX type.
+ * Appends an array entry containing a new value of NIX type.
* Returns an invalid Cursor if unsuccessful.
- * @return a valid Cursor referencing the new entry value if successful.
- **/
- public Cursor addNix();
+ *
+ * @return a valid Cursor referencing the new entry value if successful
+ */
+ Cursor addNix();
/**
- * Append an array entry containing a new value of BOOL type.
+ * Appends an array entry containing a new value of BOOL type.
* Returns an invalid Cursor if unsuccessful.
- * @param bit the actual boolean value for initializing a new BoolValue.
- * @return a valid Cursor referencing the new entry value if successful.
- **/
- public Cursor addBool(boolean bit);
+ *
+ * @param bit the actual boolean value for initializing a new BoolValue
+ * @return a valid Cursor referencing the new entry value if successful
+ */
+ Cursor addBool(boolean bit);
- /** add a new entry of LONG type to an array */
- public Cursor addLong(long l);
+ /** Adds a new entry of LONG type to an array. */
+ Cursor addLong(long l);
- /** add a new entry of DOUBLE type to an array */
- public Cursor addDouble(double d);
+ /** Adds a new entry of DOUBLE type to an array. */
+ Cursor addDouble(double d);
- /** add a new entry of STRING type to an array */
- public Cursor addString(String str);
+ /** Add a new entry of STRING type to an array. */
+ Cursor addString(String str);
- /** add a new entry of STRING type to an array */
- public Cursor addString(byte[] utf8);
+ /** Add a new entry of STRING type to an array. */
+ Cursor addString(byte[] utf8);
- /** add a new entry of DATA type to an array */
- public Cursor addData(byte[] data);
+ /** Add a new entry of DATA type to an array. */
+ Cursor addData(byte[] data);
/**
- * Append an array entry containing a new value of ARRAY type.
+ * Appends an array entry containing a new value of ARRAY type.
* Returns a valid Cursor (thay may again be used for adding new
* sub-array entries) referencing the new entry value if
* successful; otherwise returns an invalid Cursor.
- * @return new Cursor for the new entry value
- **/
- public Cursor addArray();
+ *
+ * @return a new Cursor for the new entry value
+ */
+ Cursor addArray();
/**
- * Append an array entry containing a new value of OBJECT type.
+ * Appends an array entry containing a new value of OBJECT type.
* Returns a valid Cursor (thay may again be used for setting
* sub-fields inside the new object) referencing the new entry
* value if successful; otherwise returns an invalid Cursor.
- * @return new Cursor for the new entry value
- **/
- public Cursor addObject();
+ *
+ * @return a new Cursor for the new entry value
+ */
+ Cursor addObject();
/**
- * Set a field (identified with a symbol id) to contain a new
+ * Sets a field (identified with a symbol id) to contain a new
* value of NIX type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param sym symbol id for the field to be set
* @return new Cursor for the new field value
- **/
- public Cursor setNix(int sym);
+ */
+ Cursor setNix(int sym);
/**
- * Set a field (identified with a symbol id) to contain a new
+ * Sets a field (identified with a symbol id) to contain a new
* value of BOOL type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param sym symbol id for the field to be set
* @param bit the actual boolean value for the new field
* @return new Cursor for the new field value
- **/
- public Cursor setBool(int sym, boolean bit);
+ */
+ Cursor setBool(int sym, boolean bit);
/**
- * Set a field (identified with a symbol id) to contain a new
+ * Sets a field (identified with a symbol id) to contain a new
* value of BOOL type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param sym symbol id for the field to be set
* @param l the actual long value for the new field
* @return new Cursor for the new field value
- **/
- public Cursor setLong(int sym, long l);
+ */
+ Cursor setLong(int sym, long l);
/**
- * Set a field (identified with a symbol id) to contain a new
+ * Sets a field (identified with a symbol id) to contain a new
* value of BOOL type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param sym symbol id for the field to be set
* @param d the actual double value for the new field
* @return new Cursor for the new field value
- **/
- public Cursor setDouble(int sym, double d);
+ */
+ Cursor setDouble(int sym, double d);
/**
- * Set a field (identified with a symbol id) to contain a new
+ * Sets a field (identified with a symbol id) to contain a new
* value of BOOL type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param sym symbol id for the field to be set
* @param str the actual string for the new field
- * @return new Cursor for the new field value
- **/
- public Cursor setString(int sym, String str);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setString(int sym, String str);
/**
- * Set a field (identified with a symbol id) to contain a new
+ * Sets a field (identified with a symbol id) to contain a new
* value of BOOL type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param sym symbol id for the field to be set
* @param utf8 the actual string (encoded as UTF-8 data) for the new field
- * @return new Cursor for the new field value
- **/
- public Cursor setString(int sym, byte[] utf8);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setString(int sym, byte[] utf8);
/**
- * Set a field (identified with a symbol id) to contain a new
+ * Sets a field (identified with a symbol id) to contain a new
* value of BOOL type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param sym symbol id for the field to be set
* @param data the actual data to be put into the new field
- * @return new Cursor for the new field value
- **/
- public Cursor setData(int sym, byte[] data);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setData(int sym, byte[] data);
/**
- * Set a field (identified with a symbol id) to contain a new
+ * Sets a field (identified with a symbol id) to contain a new
* value of ARRAY type. Returns a valid Cursor (thay may again be
* used for adding new array entries) referencing the new field
* value if successful; otherwise returns an invalid Cursor.
+ *
* @param sym symbol id for the field to be set
- * @return new Cursor for the new field value
- **/
- public Cursor setArray(int sym);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setArray(int sym);
/**
- * Set a field (identified with a symbol id) to contain a new
+ * Sets a field (identified with a symbol id) to contain a new
* value of OBJECT type. Returns a valid Cursor (thay may again
* be used for setting sub-fields inside the new object)
* referencing the new field value if successful; otherwise
* returns an invalid Cursor.
+ *
* @param sym symbol id for the field to be set
- * @return new Cursor for the new field value
- **/
- public Cursor setObject(int sym);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setObject(int sym);
/**
- * Set a field (identified with a symbol name) to contain a new
+ * Sets a field (identified with a symbol name) to contain a new
* value of NIX type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param name symbol name for the field to be set
- * @return new Cursor for the new field value
- **/
- public Cursor setNix(String name);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setNix(String name);
/**
- * Set a field (identified with a symbol name) to contain a new
+ * Sets a field (identified with a symbol name) to contain a new
* value of BOOL type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param name symbol name for the field to be set
* @param bit the actual boolean value for the new field
- * @return new Cursor for the new field value
- **/
- public Cursor setBool(String name, boolean bit);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setBool(String name, boolean bit);
/**
- * Set a field (identified with a symbol name) to contain a new
+ * Sets a field (identified with a symbol name) to contain a new
* value of LONG type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param name symbol name for the field to be set
* @param l the actual long value for the new field
- * @return new Cursor for the new field value
- **/
- public Cursor setLong(String name, long l);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setLong(String name, long l);
/**
- * Set a field (identified with a symbol name) to contain a new
+ * Sets a field (identified with a symbol name) to contain a new
* value of DOUBLE type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param name symbol name for the field to be set
* @param d the actual double value for the new field
- * @return new Cursor for the new field value
- **/
- public Cursor setDouble(String name, double d);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setDouble(String name, double d);
/**
- * Set a field (identified with a symbol name) to contain a new
+ * Sets a field (identified with a symbol name) to contain a new
* value of STRING type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param name symbol name for the field to be set
* @param str the actual string for the new field
- * @return new Cursor for the new field value
- **/
- public Cursor setString(String name, String str);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setString(String name, String str);
/**
- * Set a field (identified with a symbol name) to contain a new
+ * Sets a field (identified with a symbol name) to contain a new
* value of STRING type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param name symbol name for the field to be set
* @param utf8 the actual string (encoded as UTF-8 data) for the new field
- * @return new Cursor for the new field value
- **/
- public Cursor setString(String name, byte[] utf8);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setString(String name, byte[] utf8);
/**
- * Set a field (identified with a symbol name) to contain a new
+ * Sets a field (identified with a symbol name) to contain a new
* value of DATA type. Returns a valid Cursor referencing the new
* field value if successful; otherwise returns an invalid Cursor.
+ *
* @param name symbol name for the field to be set
* @param data the actual data to be put into the new field
- * @return new Cursor for the new field value
- **/
- public Cursor setData(String name, byte[] data);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setData(String name, byte[] data);
/**
- * Set a field (identified with a symbol name) to contain a new
+ * Sets a field (identified with a symbol name) to contain a new
* value of ARRAY type. Returns a valid Cursor (thay may again be
* used for adding new array entries) referencing the new field
* value if successful; otherwise returns an invalid Cursor.
+ *
* @param name symbol name for the field to be set
- * @return new Cursor for the new field value
- **/
- public Cursor setArray(String name);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setArray(String name);
/**
- * Set a field (identified with a symbol name) to contain a new
+ * Sets a field (identified with a symbol name) to contain a new
* value of OBJECT type. Returns a valid Cursor (thay may again
* be used for setting sub-fields inside the new object)
* referencing the new field value if successful; otherwise
* returns an invalid Cursor.
+ *
* @param name symbol name for the field to be set
- * @return new Cursor for the new field value
- **/
- public Cursor setObject(String name);
+ * @return a new Cursor for the new field value
+ */
+ Cursor setObject(String name);
+
}