// Path: src/main/java/com/technofovea/hllib/enums/HlAttributeType.java
// public enum HlAttributeType implements JnaEnum<HlAttributeType> {
// 
//     INVALID,
//     BOOLEAN,
//     INTEGER,
//     UNSIGNED_INTEGER,
//     FLOAT,
//     STRING;
// 
//     private static int start = 0;
// 
//     public int getIntValue() {
//         return this.ordinal()+start;
//     }
// 
// 
//     public HlAttributeType getForValue(int i) {
//         for(HlAttributeType o : this.values()){
//             if(o.getIntValue() == i){
//                 return o;
//             }
//         }
//         return null;
//     }
// 
// 
// 
// 
// 
// 
// }


import com.sun.jna.Native;
import com.sun.jna.Structure;
import com.sun.jna.Union;
import com.technofovea.hllib.enums.HlAttributeType;

package com.technofovea.hllib.datatypes;


/**
 * This class is used to retrieve "Attribute" values from HLLib. It's a bit
 * tricky.
 *
 * Generally speaking you should only need to use the following methods:
 * getType()
 * getJavaName()
 * getJavaData()
 * 
 * @author Darien Hager
 */
public class Attribute extends Structure implements Structure.ByReference {

    public static class AttributeUnion extends Union {
        /*
        public boolean Boolean = false;
        public int Integer = 0;        
        public int UnsignedInteger = 0;
        public float Float = 0;
        public byte[] String = new byte[252];
         */
        //public BooleanStruct b = new BooleanStruct();

        public boolean b = false;
        public int i = 0;
        public UnsignedStruct ui = new UnsignedStruct();
        public float f = 0;
        public byte[] s = new byte[256];
    }
    public int attribTypeId; // Ordinal of corresponding HlAttributeType
    //public HlAttributeTypeHolder attrib;

    //public int attribId;
    public byte[] nameBuf = new byte[252];
    public AttributeUnion Value = new AttributeUnion();

    
// Path: src/main/java/com/technofovea/hllib/enums/HlAttributeType.java
// public enum HlAttributeType implements JnaEnum<HlAttributeType> {
// 
//     INVALID,
//     BOOLEAN,
//     INTEGER,
//     UNSIGNED_INTEGER,
//     FLOAT,
//     STRING;
// 
//     private static int start = 0;
// 
//     public int getIntValue() {
//         return this.ordinal()+start;
//     }
// 
// 
//     public HlAttributeType getForValue(int i) {
//         for(HlAttributeType o : this.values()){
//             if(o.getIntValue() == i){
//                 return o;
//             }
//         }
//         return null;
//     }
// 
// 
// 
// 
// 
// 
// }


// Path: src/main/java/com/technofovea/hllib/datatypes/Attribute.java
import com.sun.jna.Native;
import com.sun.jna.Structure;
import com.sun.jna.Union;
import com.technofovea.hllib.enums.HlAttributeType;


package com.technofovea.hllib.datatypes;


/**
 * This class is used to retrieve "Attribute" values from HLLib. It's a bit
 * tricky.
 *
 * Generally speaking you should only need to use the following methods:
 * getType()
 * getJavaName()
 * getJavaData()
 * 
 * @author Darien Hager
 */
public class Attribute extends Structure implements Structure.ByReference {

    public static class AttributeUnion extends Union {
        /*
        public boolean Boolean = false;
        public int Integer = 0;        
        public int UnsignedInteger = 0;
        public float Float = 0;
        public byte[] String = new byte[252];
         */
        //public BooleanStruct b = new BooleanStruct();

        public boolean b = false;
        public int i = 0;
        public UnsignedStruct ui = new UnsignedStruct();
        public float f = 0;
        public byte[] s = new byte[256];
    }
    public int attribTypeId; // Ordinal of corresponding HlAttributeType
    //public HlAttributeTypeHolder attrib;

    //public int attribId;
    public byte[] nameBuf = new byte[252];
    public AttributeUnion Value = new AttributeUnion();

    
    private void doRead(HlAttributeType type) {