|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.Vector edu.stanford.slac.aida.lib.util.common.DaValue
public class DaValue
DaValue
is the AIDA overloaded data type, similar to a CORBA
Any but easier to use. DaValue
makes it easy to construct and
pass complex data types through Aida. For instance a DaValue
may be used by an Aida Data Provider servant as a convenient way to construct
structured data to be returned by the servant's get - Any method. Also
DaValue
may be returned by methods in DaObject
or DaReference
that return data values.
DaValue
extends the Java Vector class, and is organised as
follows:
DaValue
on a server, and test.Tests for example of the use of
DaValue in an Aida client.
Nested Class Summary | |
---|---|
static class |
DaValue.Type
These are the types understood by AIDA. |
Field Summary | |
---|---|
java.lang.String |
name
Some DaValues can be named, notably when they are the elements of the structure form of DaValues. |
int |
type
The type of this vector of the DaValue. |
Fields inherited from class java.util.Vector |
---|
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
DaValue()
Create an empty DaValue |
|
DaValue(org.omg.CORBA.Any a)
Construct a DaValue from an Any |
|
DaValue(java.lang.Boolean theValue)
Construct a DaValue from a Boolean |
|
DaValue(boolean[] theArray)
Construct a DaValue from an Array of boolean |
|
DaValue(java.lang.Boolean[] theArray)
Construct a DaValue from an Array of Boolean objects |
|
DaValue(java.lang.Byte theValue)
Construct a DaValue from a Byte |
|
DaValue(byte[] theArray)
Construct a DaValue from an Array of byte |
|
DaValue(java.lang.Byte[] theArray)
Construct a DaValue from an Array of byte |
|
DaValue(char[] theArray)
Construct a DaValue from an Array of char |
|
DaValue(java.lang.Character theValue)
Construct a DaValue from a Character |
|
DaValue(java.lang.Character[] theArray)
Construct a DaValue from an Array of Character objects |
|
DaValue(java.lang.Double theValue)
Construct a DaValue from a Double |
|
DaValue(double[] theArray)
Construct a DaValue from an Array of doubles |
|
DaValue(java.lang.Double[] theArray)
Construct a DaValue from an Array of Double objects |
|
DaValue(java.lang.Float theValue)
Construct a DaValue from a Float |
|
DaValue(float[] theArray)
Construct a DaValue from an Array of floats |
|
DaValue(java.lang.Float[] theArray)
Construct a DaValue from an Array of Float objects |
|
DaValue(int initialCapacity)
As with the super class, this constructor creates a DaValue with initial capacity for storing the given number of elements in its Vector. |
|
DaValue(int[] theArray)
Construct a DaValue from an Array of integers |
|
DaValue(java.lang.Integer[] theArray)
Construct a DaValue from an Array of Integer objects |
|
DaValue(int initialCapacity,
int capacityIncrement)
As with the super class, this constructor creates a DaValue with initial capacity for storing the given number of elements in its Vector and capacity increases in increments of the given capacity Increment |
|
DaValue(java.lang.Long theValue)
Construct a DaValue from a Long |
|
DaValue(long[] theArray)
Construct a DaValue from an Array of long |
|
DaValue(java.lang.Long[] theArray)
Construct a DaValue from an Array of Long objects |
|
DaValue(java.lang.Short theValue)
Construct a DaValue from a Short |
|
DaValue(short[] theArray)
Construct a DaValue from an Array of shorts |
|
DaValue(java.lang.Short[] theArray)
Construct a DaValue from an Array of Short objects |
|
DaValue(java.lang.String theValue)
Construct a DaValue from a String |
|
DaValue(java.lang.String[] theArray)
Construct a DaValue from an Array of String objects |
|
DaValue(java.lang.String name,
DaValue.Type type)
Create an empty DaValue of specified name and type |
|
DaValue(org.omg.CORBA.TypeCode tc,
org.omg.CORBA.portable.InputStream inputStream)
Constuctor from a structure member |
Method Summary | |
---|---|
void |
addArray(java.lang.Object[] o,
int theType)
Construct a DaValue from an arbitrary Array of objects |
static java.util.Vector |
booleansToNumbers(java.util.Vector booleans)
|
static DaValue |
fromAny(DaValue v,
org.omg.CORBA.Any a)
Static method that fills a DaValue from a CORBA Any. |
static DaValue |
fromAnyHeteroArray(DaValue v,
org.omg.CORBA.Any a,
org.omg.CORBA.TypeCode tc)
Static method that fills a DaValue from a CORBA Any that contains a HOMOgenous array of Any's or strings. |
static DaValue |
fromAnyHomoArray(DaValue v,
org.omg.CORBA.Any a,
org.omg.CORBA.TypeCode tc)
Static method that fills a DaValue from a CORBA Any that contains a HOMOgenous array of Basic types. |
static void |
fromStreamArray(DaValue v,
org.omg.CORBA.portable.InputStream inputStream,
org.omg.CORBA.TypeCode ptc)
Static method that fills a DaValue from a CORBA Any that contains a HOMOgenous array of Basic types. |
protected void |
generateNamedValues(NamedValues namedValues,
java.lang.String prefix)
|
boolean[] |
getAsBooleans()
|
byte[] |
getAsBytes()
|
double[] |
getAsDoubles()
|
float[] |
getAsFloats()
|
int[] |
getAsInts()
|
long[] |
getAsLongs()
|
short[] |
getAsShorts()
|
java.lang.String[] |
getAsStrings()
|
boolean |
getBoolean(int i)
|
boolean[] |
getBooleans()
|
byte |
getByte(int i)
|
byte[] |
getBytes()
|
double |
getDouble()
|
double |
getDouble(int i)
|
double[] |
getDoubles()
|
float |
getFloat()
|
float |
getFloat(int i)
|
float[] |
getFloats()
|
int |
getInt()
|
int |
getInt(int i)
|
int[] |
getInts()
|
long |
getLong()
|
long |
getLong(int i)
|
long[] |
getLongs()
|
NamedValues |
getNamedValues()
|
DaValue |
getPrimaryElement()
Returns the basic element of this DaValue that is considered the "primary" one. |
short |
getShort(int i)
|
short[] |
getShorts()
|
java.lang.String |
getString()
|
java.lang.String |
getString(int i)
|
java.lang.String[] |
getStrings()
|
boolean |
isBoolean()
|
boolean |
isByte()
|
boolean |
isDouble()
|
boolean |
isFloat()
|
boolean |
isInt()
|
boolean |
isLong()
|
boolean |
isNumeric()
|
boolean |
isShort()
|
boolean |
isString()
|
static boolean[] |
numbersToBooleans(java.util.Vector numbers)
|
static byte[] |
numbersToBytes(java.util.Vector numbers)
|
static double[] |
numbersToDoubles(java.util.Vector numbers)
|
static float[] |
numbersToFloats(java.util.Vector numbers)
|
static int[] |
numbersToInts(java.util.Vector numbers)
|
static long[] |
numbersToLongs(java.util.Vector numbers)
|
static short[] |
numbersToShorts(java.util.Vector numbers)
|
void |
setName(java.lang.String theName)
Set the name of this vector of the DaValue |
static boolean[] |
stringsToBooleans(java.util.Vector strings)
|
static java.util.Vector |
stringsToDoubleNumbers(java.util.Vector strings)
|
static java.util.Vector |
stringsToFloatNumbers(java.util.Vector strings)
|
org.omg.CORBA.Any |
toAny()
Create an Any from this DaValue Encodes this DaValue into a CORBA Any |
static org.omg.CORBA.Any |
toAny(DaValue v,
org.omg.CORBA.Any a)
Static method to create an Any that represents an arbitrary DaValue |
Methods inherited from class java.util.Vector |
---|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
iterator, listIterator, listIterator |
Field Detail |
---|
public int type
public java.lang.String name
Constructor Detail |
---|
public DaValue()
public DaValue(java.lang.String name, DaValue.Type type)
public DaValue(int initialCapacity)
initialCapacity
- Initial capacity. Vector initially has capacity for this
number of elementsVector(int)
public DaValue(int initialCapacity, int capacityIncrement)
initialCapacity
- The initial capacity. Vector initially has capacity for this
number of elementscapacityIncrement
- Each time capacity needs to be increased increase by this
amount.Vector.Vector(int, int)
public DaValue(java.lang.Boolean theValue)
theValue
- Boolean value to be copied into the new DaValue's first and
only elementpublic DaValue(java.lang.Byte theValue)
theValue
- Byte value to be copied into the new DaValue's first and only
elementpublic DaValue(java.lang.Character theValue)
theValue
- Character value to be copied into the new DaValue's first and
only elementpublic DaValue(java.lang.Double theValue)
theValue
- Double value to be copied into the new DaValue's first and
only elementpublic DaValue(java.lang.Float theValue)
theValue
- Float value to be copied into the new DaValue's first and only
elementpublic DaValue(java.lang.Long theValue)
theValue
- Long value to be copied into the new DaValue's first and only
elementpublic DaValue(java.lang.Short theValue)
theValue
- Short value to be copied into the new DaValue's first and only
elementpublic DaValue(java.lang.String theValue)
theValue
- String value to be copied into the new DaValue's first and
only elementpublic DaValue(org.omg.CORBA.Any a)
a
- CORBA Any that will be used to construct this new DaValuepublic DaValue(boolean[] theArray)
theArray
- boolean array whose elements are copied into corresponding
Boolean elements in the Vector of this new DaValuepublic DaValue(byte[] theArray)
theArray
- byte array whose elements are copied into corresponding Byte
elements in the Vector of this new DaValuepublic DaValue(char[] theArray)
theArray
- char array whose elements are copied into corresponding
Character elements in the Vector of this new DaValuepublic DaValue(double[] theArray)
theArray
- double array whose elements are copied into corresponding
Double elements in the Vector of this new DaValuepublic DaValue(float[] theArray)
theArray
- float array whose elements are copied into corresponding Float
elements in the Vector of this new DaValuepublic DaValue(long[] theArray)
theArray
- long array whose elements are copied into corresponding Long
elements in the Vector of this new DaValuepublic DaValue(int[] theArray)
theArray
- int array whose elements are copied into corresponding Long
elements in the Vector of this new DaValuepublic DaValue(short[] theArray)
theArray
- short array whose elements are copied into corresponding Short
elements in the Vector of this new DaValuepublic DaValue(java.lang.String[] theArray)
theArray
- String array whose elements are copied into corresponding
String elements in the Vector of this new DaValuepublic DaValue(java.lang.Boolean[] theArray)
theArray
- Boolean array whose elements are copied into corresponding
Boolean elements in the Vector of this new DaValuepublic DaValue(java.lang.Byte[] theArray)
theArray
- Byte array whose elements are copied into corresponding Byte
elements in the Vector of this new DaValuepublic DaValue(java.lang.Character[] theArray)
theArray
- Character array whose elements are copied into corresponding
Character elements in the Vector of this new DaValuepublic DaValue(java.lang.Double[] theArray)
theArray
- Double array whose elements are copied into corresponding
Double elements in the Vector of this new DaValuepublic DaValue(java.lang.Float[] theArray)
theArray
- Float array whose elements are copied into corresponding Float
elements in the Vector of this new DaValuepublic DaValue(java.lang.Long[] theArray)
theArray
- Long array whose elements are copied into corresponding Long
elements in the Vector of this new DaValuepublic DaValue(java.lang.Integer[] theArray)
theArray
- Integer array whose elements are copied into corresponding
Long elements in the Vector of this new DaValuepublic DaValue(java.lang.Short[] theArray)
theArray
- Short array whose elements are copied into corresponding Short
elements in the Vector of this new DaValuepublic DaValue(org.omg.CORBA.TypeCode tc, org.omg.CORBA.portable.InputStream inputStream)
m
- StructureMemberMethod Detail |
---|
public void addArray(java.lang.Object[] o, int theType)
o
- arbitrary array whose elements are copied into corresponding
elements in the Vector of this DaValuetheType
- the type of the elements of the arraypublic void setName(java.lang.String theName)
theName
- name to set for this vectorpublic DaValue getPrimaryElement()
public static DaValue fromAnyHeteroArray(DaValue v, org.omg.CORBA.Any a, org.omg.CORBA.TypeCode tc)
v
- DaValue to store decoded CORBA Anya
- CORBA Any to decode into the DaValue.tc
- CORBA TypeCode discriminator that describes the given CORBA
Any
java.lang.IllegalArgumentException
- Error in string comparison operation on TypeCode.idpublic static void fromStreamArray(DaValue v, org.omg.CORBA.portable.InputStream inputStream, org.omg.CORBA.TypeCode ptc)
v
- DaValue to store decoded CORBA Anya
- CORBA Any to decode into the DaValue.tc
- CORBA TypeCode discriminator that describes the given CORBA
Anypublic static DaValue fromAnyHomoArray(DaValue v, org.omg.CORBA.Any a, org.omg.CORBA.TypeCode tc)
v
- DaValue to store decoded CORBA Anya
- CORBA Any to decode into the DaValue.tc
- CORBA TypeCode discriminator that describes the given CORBA
Any
public static DaValue fromAny(DaValue v, org.omg.CORBA.Any a)
v
- DaValue to store decoded CORBA Anya
- CORBA Any to decode into the DaValue.
public org.omg.CORBA.Any toAny()
public static org.omg.CORBA.Any toAny(DaValue v, org.omg.CORBA.Any a)
v
- DaValue to decodea
- CORBA Any to write decoded DaValue into.
public static boolean[] numbersToBooleans(java.util.Vector numbers)
public static byte[] numbersToBytes(java.util.Vector numbers)
public static short[] numbersToShorts(java.util.Vector numbers)
public static int[] numbersToInts(java.util.Vector numbers)
public static long[] numbersToLongs(java.util.Vector numbers)
public static float[] numbersToFloats(java.util.Vector numbers)
public static double[] numbersToDoubles(java.util.Vector numbers)
public static java.util.Vector stringsToFloatNumbers(java.util.Vector strings)
public static java.util.Vector stringsToDoubleNumbers(java.util.Vector strings)
public static boolean[] stringsToBooleans(java.util.Vector strings)
public static java.util.Vector booleansToNumbers(java.util.Vector booleans)
public boolean isNumeric()
public boolean isBoolean()
public boolean getBoolean(int i)
public boolean[] getBooleans()
public boolean[] getAsBooleans()
public boolean isByte()
public byte getByte(int i)
public byte[] getBytes()
public byte[] getAsBytes()
public boolean isShort()
public short getShort(int i)
public short[] getShorts()
public short[] getAsShorts()
public boolean isInt()
public int getInt(int i)
public int getInt()
public int[] getInts()
public int[] getAsInts()
public boolean isLong()
public long getLong(int i)
public long getLong()
public long[] getLongs()
public long[] getAsLongs()
public boolean isFloat()
public float getFloat(int i)
public float getFloat()
public float[] getFloats()
public float[] getAsFloats()
public boolean isDouble()
public double getDouble(int i)
public double getDouble()
public double[] getDoubles()
public double[] getAsDoubles()
public boolean isString()
public java.lang.String getString(int i)
public java.lang.String getString()
public java.lang.String[] getStrings()
public java.lang.String[] getAsStrings()
public NamedValues getNamedValues()
protected void generateNamedValues(NamedValues namedValues, java.lang.String prefix)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |