# MeshSpecification.Attribute

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute#pubctors)\|[Methods](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute#inhmethods)  

# MeshSpecification.Attribute

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/graphics/MeshSpecification.Attribute "View this page in Kotlin")\|Java

`
public
static


class
MeshSpecification.Attribute
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|----------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.graphics.MeshSpecification.Attribute |

<br />

*** ** * ** ***

Data class to represent a single attribute in a shader. An attribute is a variable that accompanies a vertex, this can be a color or texture coordinates. See https://developer.android.com/develop/ui/views/graphics/agsl for more information regarding Android Graphics Shader Language. Note that offset is the offset in number of bytes. For example, if we had two attributes  

```
 Float3 att1
 Float att2
 
```
att1 would have an offset of 0, while att2 would have an offset of 12 bytes. This is consumed as part of[MeshSpecification.make(Attribute[], int, Varying[], String, String, ColorSpace, int)](https://developer.android.com/reference/android/graphics/MeshSpecification#make(android.graphics.MeshSpecification.Attribute[],%20int,%20android.graphics.MeshSpecification.Varying[],%20java.lang.String,%20java.lang.String,%20android.graphics.ColorSpace,%20int))to create a[MeshSpecification](https://developer.android.com/reference/android/graphics/MeshSpecification)instance.

<br />

## Summary

|                                                                                                                ### Public constructors                                                                                                                ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Attribute](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute#Attribute(int,%20int,%20java.lang.String))`(int type, int offset, `[String](https://developer.android.com/reference/java/lang/String)` name) ` |

|                                                                                                                                                           ### Public methods                                                                                                                                                           ||
|-----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[getName](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute#getName())`() ` Return the name of this[Attribute](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute)                      |
| ` int`                                                                | ` `[getOffset](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute#getOffset())`() ` Return the offset of the attribute in bytes                                                                                               |
| ` int`                                                                | ` `[getType](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute#getType())`() ` Return the corresponding data type for this[Attribute](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute). |
| ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[toString](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute#toString())`() ` Returns a string representation of the object.                                                                                              |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### Attribute

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Attribute (int type, 
                int offset, 
                String name)
```

<br />

<br />

|                                                                                                                                                                                                                                                                                                                        Parameters                                                                                                                                                                                                                                                                                                                        ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type`   | `int`: Value is[MeshSpecification.TYPE_FLOAT](https://developer.android.com/reference/android/graphics/MeshSpecification#TYPE_FLOAT),[MeshSpecification.TYPE_FLOAT2](https://developer.android.com/reference/android/graphics/MeshSpecification#TYPE_FLOAT2),[MeshSpecification.TYPE_FLOAT3](https://developer.android.com/reference/android/graphics/MeshSpecification#TYPE_FLOAT3),[MeshSpecification.TYPE_FLOAT4](https://developer.android.com/reference/android/graphics/MeshSpecification#TYPE_FLOAT4), or[MeshSpecification.TYPE_UBYTE4](https://developer.android.com/reference/android/graphics/MeshSpecification#TYPE_UBYTE4) <br /> |
| `offset` | `int` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `name`   | `String`: This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

## Public methods

### getName

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String getName ()
```

Return the name of this[Attribute](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute)

<br />

|                                                Returns                                                 ||
|--------------------------------------------------------------------|------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | This value cannot be`null`. <br /> |

### getOffset

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getOffset ()
```

Return the offset of the attribute in bytes

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getType

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getType ()
```

Return the corresponding data type for this[Attribute](https://developer.android.com/reference/android/graphics/MeshSpecification.Attribute).

<br />

|                                                                                                                                                                                                                                                                                                                    Returns                                                                                                                                                                                                                                                                                                                     ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[MeshSpecification.TYPE_FLOAT](https://developer.android.com/reference/android/graphics/MeshSpecification#TYPE_FLOAT),[MeshSpecification.TYPE_FLOAT2](https://developer.android.com/reference/android/graphics/MeshSpecification#TYPE_FLOAT2),[MeshSpecification.TYPE_FLOAT3](https://developer.android.com/reference/android/graphics/MeshSpecification#TYPE_FLOAT3),[MeshSpecification.TYPE_FLOAT4](https://developer.android.com/reference/android/graphics/MeshSpecification#TYPE_FLOAT4), or[MeshSpecification.TYPE_UBYTE4](https://developer.android.com/reference/android/graphics/MeshSpecification#TYPE_UBYTE4) <br /> |

### toString

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String toString ()
```

Returns a string representation of the object.

<br />

|                                                      Returns                                                      ||
|--------------------------------------------------------------------|-----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | a string representation of the object. <br /> |