Class RightValueUtility

java.lang.Object
com.scriptbasic.utility.RightValueUtility

public final class RightValueUtility
extends java.lang.Object
Author:
Peter Verhas date June 26, 2012
  • Method Summary

    Modifier and Type Method Description
    static java.lang.Integer convert2Integer​(RightValue index)  
    static RightValue createRightValue​(java.lang.Object value)
    Create a right value from the object.
    static RightValue[] createRightValues​(java.lang.Object[] values)
    Create a right value array from an object array.
    static java.lang.Object getValueObject​(RightValue arg)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getValueObject

      public static java.lang.Object getValueObject​(RightValue arg)
    • convert2Integer

      public static java.lang.Integer convert2Integer​(RightValue index) throws ScriptBasicException
      Throws:
      ScriptBasicException
    • createRightValue

      public static RightValue createRightValue​(java.lang.Object value)
      Create a right value from the object. If the object is already a right value then just return the object. If the object is some primitive object (Long, Integer, Short, Float, Double, String, Character, Boolean then it creates a Basic object that holds a Long, Double, String or Boolean value.

      In other cases the method will return a BasicJavaObjectValue.

      Parameters:
      value - the original value to convert to a right value
      Returns:
      the converted right value
    • createRightValues

      public static RightValue[] createRightValues​(java.lang.Object[] values)
      Create a right value array from an object array. Allocate the new array and convert each element of the object array into a right value.
      Parameters:
      values - the object array to convert to right values
      Returns:
      the array of right values converted from the object array