PTP
Release 5.0

org.eclipse.ptp.debug.core.pdi.model.aif
Class AIFFactory

java.lang.Object
  extended by org.eclipse.ptp.debug.core.pdi.model.aif.AIFFactory

public class AIFFactory
extends java.lang.Object


Nested Class Summary
static class AIFFactory.SimpleByteBuffer
           
 
Field Summary
static char FDS_ADDRESS
           
static char FDS_AGGREGATE
           
static char FDS_AGGREGATE_ACCESS_SEP
           
static char FDS_AGGREGATE_END
           
static char FDS_AGGREGATE_FIELD_NAME_END
           
static char FDS_AGGREGATE_FIELD_SEP
           
static char FDS_ARRAY
           
static char FDS_ARRAY_END
           
static char FDS_BOOL
           
static char FDS_CHAR
           
static char FDS_CHAR_POINTER
           
static char FDS_ENUM
           
static char FDS_ENUM_CONST_SEP
           
static char FDS_ENUM_END
           
static char FDS_ENUM_SEP
           
static char FDS_FLOAT
           
static int FDS_FLOAT_SIZE_POS
           
static char FDS_FUNCTION
           
static char FDS_FUNCTION_ARG_SEP
           
static char FDS_FUNCTION_END
           
static char FDS_INT
           
static int FDS_INTEGER_SIGN_POS
           
static char FDS_INTEGER_SIGNED
           
static int FDS_INTEGER_SIZE_POS
           
static char FDS_INTEGER_UNSIGNED
           
static char FDS_NAMED
           
static char FDS_NAMED_END
           
static char FDS_POINTER
           
static char FDS_RANGE
           
static char FDS_RANGE_SEP
           
static char FDS_REFERENCE
           
static char FDS_REFERENCE_END
           
static char FDS_STRING
           
static char FDS_TYPENAME_END
           
static char FDS_UNION
           
static char FDS_UNION_END
           
static char FDS_UNION_FIELD_NAME_END
           
static char FDS_UNION_FIELD_SEP
           
static char FDS_VOID
           
static int FDS_VOID_SIZE_POS
           
static int NO_SIZE
           
static int SIZE_BOOL
           
static int SIZE_CHAR
           
static int SIZE_DOUBLE
           
static int SIZE_FLOAT
           
static int SIZE_INVALID
           
static IAIFType UNKNOWNTYPE
           
static IAIFValue UNKNOWNVALUE
           
 
Constructor Summary
AIFFactory()
           
 
Method Summary
static IAIFType getAIFType(java.lang.String fmt)
          Construct an AIF type given a FDS.
static IAIFValue getAIFValue(IValueParent parent, IAIFType type, AIFFactory.SimpleByteBuffer buffer)
          Create a value given a type and a buffer containing the value data.
static IAIFValue getAIFValue(IValueParent parent, IAIFType type, byte[] data)
          Create a value given a type and an array containing the value data.
static int getFirstNonDigitPos(java.lang.String format, int start, boolean neg)
          Find the first character position immediately after an integer in the string starting at position 'pos'.
static IAIFType getType()
          Get the last type that was successfully parsed.
static IAIF newAIF(IAIFType aifType, IAIFValue aifValue)
          Create an IAIF object from a type and a value
static IAIF newAIF(IAIFType aifType, IAIFValue aifValue, java.lang.String desc)
          Create an IAIF object from a type and a value
static IAIF newAIF(java.lang.String fds, byte[] data)
          Create an AIF object given an FDS and value data
static IAIF newAIF(java.lang.String fds, byte[] data, java.lang.String description)
          Create an AIF object given an FDS and value data
static java.lang.String parseType(java.lang.String fmt)
          Parse a complete AIF type from the format descriptor.
static int random_num(int min, int max)
          testing purpose
static IAIF UNKNOWNAIF()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FDS_ARRAY

public static final char FDS_ARRAY
See Also:
Constant Field Values

FDS_BOOL

public static final char FDS_BOOL
See Also:
Constant Field Values

FDS_CHAR

public static final char FDS_CHAR
See Also:
Constant Field Values

FDS_ENUM

public static final char FDS_ENUM
See Also:
Constant Field Values

FDS_FLOAT

public static final char FDS_FLOAT
See Also:
Constant Field Values

FDS_FUNCTION

public static final char FDS_FUNCTION
See Also:
Constant Field Values

FDS_INT

public static final char FDS_INT
See Also:
Constant Field Values

FDS_POINTER

public static final char FDS_POINTER
See Also:
Constant Field Values

FDS_STRING

public static final char FDS_STRING
See Also:
Constant Field Values

FDS_AGGREGATE

public static final char FDS_AGGREGATE
Since:
4.0
See Also:
Constant Field Values

FDS_UNION

public static final char FDS_UNION
See Also:
Constant Field Values

FDS_VOID

public static final char FDS_VOID
See Also:
Constant Field Values

FDS_REFERENCE

public static final char FDS_REFERENCE
See Also:
Constant Field Values

FDS_NAMED

public static final char FDS_NAMED
See Also:
Constant Field Values

FDS_ADDRESS

public static final char FDS_ADDRESS
See Also:
Constant Field Values

FDS_RANGE

public static final char FDS_RANGE
Since:
4.0
See Also:
Constant Field Values

FDS_CHAR_POINTER

public static final char FDS_CHAR_POINTER
See Also:
Constant Field Values

FDS_FLOAT_SIZE_POS

public static final int FDS_FLOAT_SIZE_POS
See Also:
Constant Field Values

FDS_VOID_SIZE_POS

public static final int FDS_VOID_SIZE_POS
See Also:
Constant Field Values

FDS_INTEGER_SIGN_POS

public static final int FDS_INTEGER_SIGN_POS
See Also:
Constant Field Values

FDS_INTEGER_SIZE_POS

public static final int FDS_INTEGER_SIZE_POS
See Also:
Constant Field Values

FDS_ARRAY_END

public static final char FDS_ARRAY_END
Since:
4.0
See Also:
Constant Field Values

FDS_TYPENAME_END

public static final char FDS_TYPENAME_END
Since:
4.0
See Also:
Constant Field Values

FDS_AGGREGATE_FIELD_NAME_END

public static final char FDS_AGGREGATE_FIELD_NAME_END
Since:
4.0
See Also:
Constant Field Values

FDS_AGGREGATE_FIELD_SEP

public static final char FDS_AGGREGATE_FIELD_SEP
Since:
4.0
See Also:
Constant Field Values

FDS_AGGREGATE_ACCESS_SEP

public static final char FDS_AGGREGATE_ACCESS_SEP
Since:
4.0
See Also:
Constant Field Values

FDS_AGGREGATE_END

public static final char FDS_AGGREGATE_END
Since:
4.0
See Also:
Constant Field Values

FDS_UNION_FIELD_NAME_END

public static final char FDS_UNION_FIELD_NAME_END
Since:
4.0
See Also:
Constant Field Values

FDS_UNION_FIELD_SEP

public static final char FDS_UNION_FIELD_SEP
Since:
4.0
See Also:
Constant Field Values

FDS_UNION_END

public static final char FDS_UNION_END
Since:
4.0
See Also:
Constant Field Values

FDS_ENUM_CONST_SEP

public static final char FDS_ENUM_CONST_SEP
Since:
4.0
See Also:
Constant Field Values

FDS_ENUM_SEP

public static final char FDS_ENUM_SEP
Since:
4.0
See Also:
Constant Field Values

FDS_ENUM_END

public static final char FDS_ENUM_END
See Also:
Constant Field Values

FDS_FUNCTION_END

public static final char FDS_FUNCTION_END
See Also:
Constant Field Values

FDS_FUNCTION_ARG_SEP

public static final char FDS_FUNCTION_ARG_SEP
Since:
4.0
See Also:
Constant Field Values

FDS_INTEGER_SIGNED

public static final char FDS_INTEGER_SIGNED
Since:
4.0
See Also:
Constant Field Values

FDS_INTEGER_UNSIGNED

public static final char FDS_INTEGER_UNSIGNED
Since:
4.0
See Also:
Constant Field Values

FDS_REFERENCE_END

public static final char FDS_REFERENCE_END
See Also:
Constant Field Values

FDS_NAMED_END

public static final char FDS_NAMED_END
See Also:
Constant Field Values

FDS_RANGE_SEP

public static final char FDS_RANGE_SEP
Since:
4.0
See Also:
Constant Field Values

NO_SIZE

public static final int NO_SIZE
See Also:
Constant Field Values

SIZE_BOOL

public static final int SIZE_BOOL
See Also:
Constant Field Values

SIZE_CHAR

public static final int SIZE_CHAR
See Also:
Constant Field Values

SIZE_FLOAT

public static final int SIZE_FLOAT
See Also:
Constant Field Values

SIZE_DOUBLE

public static final int SIZE_DOUBLE
See Also:
Constant Field Values

SIZE_INVALID

public static final int SIZE_INVALID
See Also:
Constant Field Values

UNKNOWNTYPE

public static final IAIFType UNKNOWNTYPE

UNKNOWNVALUE

public static final IAIFValue UNKNOWNVALUE
Constructor Detail

AIFFactory

public AIFFactory()
Method Detail

getAIFType

public static IAIFType getAIFType(java.lang.String fmt)
                           throws AIFFormatException
Construct an AIF type given a FDS.

Parameters:
fmt - format descriptor string
Returns:
IAIFType representing the FDS
Throws:
AIFFormatException - if the string can't be parsed

getAIFValue

public static IAIFValue getAIFValue(IValueParent parent,
                                    IAIFType type,
                                    byte[] data)
Create a value given a type and an array containing the value data.

Parameters:
parent - parent value (if this value has a parent)
type - type of the value
data - raw data
Returns:
an IAIFValue representing the data

getAIFValue

public static IAIFValue getAIFValue(IValueParent parent,
                                    IAIFType type,
                                    AIFFactory.SimpleByteBuffer buffer)
Create a value given a type and a buffer containing the value data.

Parameters:
parent - parent value (if this value has a parent)
type - type of the value
buffer - buffer containing the data
Returns:
an IAIFValue representing the value

getFirstNonDigitPos

public static int getFirstNonDigitPos(java.lang.String format,
                                      int start,
                                      boolean neg)
Find the first character position immediately after an integer in the string starting at position 'pos'. If 'neg' is true then negative integers are allowed.

Parameters:
format - format string
start - position in string to start
neg - allow negative numbers
Returns:
first character after integer
Since:
4.0

getType

public static IAIFType getType()
Get the last type that was successfully parsed.

Returns:
IAIFType
Since:
4.0

newAIF

public static IAIF newAIF(IAIFType aifType,
                          IAIFValue aifValue)
Create an IAIF object from a type and a value

Parameters:
aifType - type of the object
aifValue - value of the object
Returns:
new IAIF object

newAIF

public static IAIF newAIF(IAIFType aifType,
                          IAIFValue aifValue,
                          java.lang.String desc)
Create an IAIF object from a type and a value

Parameters:
aifType - type of the object
aifValue - value of the object
desc - description
Returns:
new IAIF object
Since:
4.0

newAIF

public static IAIF newAIF(java.lang.String fds,
                          byte[] data)
                   throws AIFFormatException
Create an AIF object given an FDS and value data

Parameters:
fds - format descriptor string
data - value data
Returns:
new IAIF object
Throws:
AIFFormatException - if the FDS can't be parsed

newAIF

public static IAIF newAIF(java.lang.String fds,
                          byte[] data,
                          java.lang.String description)
                   throws AIFFormatException
Create an AIF object given an FDS and value data

Parameters:
fds - format descriptor string
data - value data
description -
Returns:
new IAIF object
Throws:
AIFFormatException - if the FDS can't be parsed

parseType

public static java.lang.String parseType(java.lang.String fmt)
                                  throws AIFFormatException
Parse a complete AIF type from the format descriptor. A newly constructed IAIFType objects will be available by calling getType()

Parameters:
fmt - format descriptor
Returns:
remainder of string after removing the complete FDS
Throws:
AIFFormatException - if the string can't be parsed
Since:
4.0

random_num

public static int random_num(int min,
                             int max)
testing purpose


UNKNOWNAIF

public static IAIF UNKNOWNAIF()
Returns:

PTP
Release 5.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.