|
Reality Interface Classes | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.northgateis.reality.util
Class ItemView
java.lang.Object | +--com.northgateis.reality.util.ItemView
- public class ItemView
- extends java.lang.Object
Defines an object that allows a Reality item to be broken down into attributes, values and subvalues.
The delimiters are optionally definable.
Any trailing segment mark is ignored.
The attributes of the item are mapped when the class is created. Values and subvalues are only mapped as required to optimise performance.
Field Summary | |
static byte
|
AM
Reality attribute mark delimiter |
static byte
|
SM
Reality segment mark delimiter |
static byte
|
SVM
Reality subvalue mark delimiter |
static byte
|
VM
Reality value mark delimiter |
Constructor Summary | |
ItemView(byte[] itm) Create a new item view with normal system delimiters (AM, VM, SVM) | |
ItemView(byte[] itm,
byte del1,
byte del2,
byte del3) Create a new item view with user defined delimiters |
Method Summary | |
int | copy(int attribute,
byte[] buf,
int start) Get an attribute from the item and copy it to callers buffer |
int | copy(int attribute,
int value,
byte[] buf,
int start) Get a value from an attribute in the item and copy it to callers buffer |
int | copy(int attribute,
int value,
int subValue,
byte[] buf,
int start) Get a subvalue from a value in the item and copy it to callers buffer |
byte[] | get(int attribute) Get an attribute from the item |
byte[] | get(int attribute,
int value) Get a value from an attribute in the item |
byte[] | get(int attribute,
int value,
int subValue) Get a subvalue from a value in the item |
byte[] | getAll() Get the whole item |
int | getLength() Get the whole item length |
static void | main(java.lang.String[] args) Test method |
int | numAttributes() Get the number of attributes in the item |
int | numSubValues(int attribute,
int value) Get the number of subvalues in a value |
int | numValues(int attribute) Get the number of values in an attribute |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
SM
public static final byte SM
- Reality segment mark delimiter.
AM
public static final byte AM
- Reality attribute mark delimiter.
VM
public static final byte VM
- Reality value mark delimiter.
SVM
public static final byte SVM
- Reality subvalue mark delimiter.
Constructor Detail |
ItemView
public ItemView(byte[] itm)
- Create a new item view with normal system delimiters (AM, VM, SVM).
- Parameters:
item
- byte array holding the Reality item to be viewed.
ItemView
public ItemView(byte[] itm, byte del1, byte del2, byte del3)
- Create a new item view with user defined delimiters.
- Parameters:
item
- byte array holding the reality item to be viewed.del1
- byte containing first level delimiter.del2
- byte containing second level delimiter.del3
- byte containing third level delimiter.
Method Detail |
getAll
public byte[] getAll()
- Get the whole item.
- Returns:
- pointer to byte array containing item.
getLength
public int getLength()
- Get the whole item length.
- Returns:
- integer length of item.
get
public byte[] get(int attribute)
- Get an attribute from the item.
- Parameters:
attribute
- integer number of attribute to get.- Returns:
- new byte array containing attribute.
copy
public int copy(int attribute, byte[] buf, int start)
- Get an attribute from the item and copy it to callers buffer.
- Parameters:
attribute
- integer number of attribute to get.buf
- byte array to hold attribute.start
- where to copy attribute into buf.- Returns:
- length of attribute.
get
public byte[] get(int attribute, int value)
- Get a value from an attribute in the item.
- Parameters:
attribute
- integer number of attribute.value
- integer number of value to get.- Returns:
- new byte array containing the value.
copy
public int copy(int attribute, int value, byte[] buf, int start)
- Get a value from an attribute in the item and copy it to callers buffer.
- Parameters:
attribute
- integer number of attribute.value
- integer number of value to get.buf
- byte array to hold value.start
- where to copy value into buf.- Returns:
- length of value.
get
public byte[] get(int attribute, int value, int subValue)
- Get a subvalue from a value in the item.
- Parameters:
attribute
- integer number of attribute.value
- integer number of value to get.subValue
- integer number of subvalue to get.- Returns:
- new byte array containing the subvalue.
copy
public int copy(int attribute, int value, int subValue, byte[] buf, int start)
- Get a subvalue from a value in the item and copy it to callers buffer.
- Parameters:
attribute
- integer number of attribute.value
- integer number of value to get.subValue
- integer number of subvalue to get.buf
- byte array to hold subvalue.start
- where to copy subvalue into buf.- Returns:
- length of subvalue.
numAttributes
public int numAttributes()
- Get the number of attributes in the item.
- Returns:
- integer number of attributes in item.
numValues
public int numValues(int attribute)
- Get the number of values in an attribute.
- Parameters:
attribute
- integer number of attribute.- Returns:
- integer number of attributes in item.
numSubValues
public int numSubValues(int attribute, int value)
- Get the number of subvalues in a value.
- Parameters:
attribute
- integer number of attribute.value
- integer number of value to get.- Returns:
- integer number of attributes in item.
main
public static void main(java.lang.String[] args)
- Test method.
| Reality Interface Classes | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2000 NEC Software Services (UK) Limited