Indexed samples

Samples are indexed from 0 to count-1. A lot of method have the form xxxAt(int idx) and therefor refer to the sample at index idx. With the indexAt and units/positionAt methods you can shift between index and domain position. The index of a domain position belongs to the sample at the given domain position or the first one before.

A sample can be of type none, meaning it has no data or is not existing. A meaning of a "conflict" sample is use-case depended. If true, impulse will use conflict color (usually red) to paint the sample.

The sample value

Looking at the interface methods below you will find four types of value accessors:

Members

If a sample value contains a structure, like arrays and struct samples, you can use the interface IReadableMembers. You get an value object of type IReadableMembers:

If you use the compoundAt(int idx) method.

If the raw value is of type Struct or Transaction (Struct signal type).

If you use a sample pointer (see next chapter).

The member value and formatting method are the same as above, just with the difference that they don't refer an index but a member (xxxOf(Object member)). The member object value can either be a string (for the name of the member, or an integer for its id (struct) or index (arrays).

The first section of IReadableMembers handles general member information:

noOfMembers(): No of members in the given sample.

nameOf(int member): Name of the member at given index (0--noOfMembers-1).

hasMember(String member): Returns true if the value contains a member with the given name.

memberWithContent(String content): Returns the first member that is marked to contain the given content.