@Override public JBBPFieldBoolean getElementAt(final int index) { final JBBPFieldBoolean result = new JBBPFieldBoolean(this.fieldNameInfo, getAsBool(index)); result.payload = this.payload; return result; }
@Override public JBBPFieldBit getElementAt(final int index) { final JBBPFieldBit result = new JBBPFieldBit(this.fieldNameInfo, this.getAsInt(index), this.bitNumber); result.payload = this.payload; return result; }
/** * Map the structure fields to a class fields. * * @param <T> a class type * @param mappingClass a mapping class to be mapped by the structure fields, * must not be null and must have the default constructor * @return a mapped instance of the class, must not be null */ public <T> T mapTo(final Class<T> mappingClass) { return mapTo(mappingClass, null); }
@Override public JBBPFieldLong getElementAt(final int index) { final JBBPFieldLong result = new JBBPFieldLong(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; }
@Override public JBBPFieldUByte getElementAt(final int index) { final JBBPFieldUByte result = new JBBPFieldUByte(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; }
@Override public JBBPFieldInt getElementAt(final int index) { final JBBPFieldInt result = new JBBPFieldInt(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; }
@Override public JBBPFieldUShort getElementAt(final int index) { final JBBPFieldUShort result = new JBBPFieldUShort(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; }
@Override public JBBPFieldDouble getElementAt(final int index) { final JBBPFieldDouble result = new JBBPFieldDouble(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; }
@Override public JBBPFieldFloat getElementAt(final int index) { final JBBPFieldFloat result = new JBBPFieldFloat(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; }
@Override public JBBPFieldShort getElementAt(final int index) { final JBBPFieldShort result = new JBBPFieldShort(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; }
@Override public JBBPFieldString getElementAt(final int index) { final JBBPFieldString result = new JBBPFieldString(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; }
@Override public JBBPFieldByte getElementAt(final int index) { final JBBPFieldByte result = new JBBPFieldByte(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; }
@Override public long getAsInvertedBitOrder() { return reverseBits(this.value); }
@Override public long getAsLong(final int index) { return this.getAsInt(index); }
@Override public long getAsLong(final int index) { return this.getAsInt(index); }
@Override public long getAsLong(final int index) { return this.getAsInt(index); }
@Override public long getAsLong() { return this.getAsInt(); }
@Override public long getAsInvertedBitOrder() { return reverseBits(this.value); }
/** * Map the structure fields to object fields. * * @param objectToMap an object to map fields of the structure, must not be * null * @return the same object from the arguments but with filled fields by values * of the structure */ public Object mapTo(final Object objectToMap) { return this.mapTo(objectToMap, null); }
/** * Map the structure fields to a class fields. * * @param <T> a class type * @param mappingClass a mapping class to be mapped by the structure fields, * must not be null and must have the default constructor * @param flags special flags to tune mapping * @return a mapped instance of the class, must not be null */ public <T> T mapTo(final Class<T> mappingClass, final int flags) { return mapTo(mappingClass, null, flags); }