Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
org.direct_bt.EUI48Sub Class Reference

A 48 bit EUI-48 sub-identifier, see EUI48. More...

Collaboration diagram for org.direct_bt.EUI48Sub:

Public Member Functions

 EUI48Sub ()
 Construct empty unset instance. More...
 
 EUI48Sub (final String str) throws IllegalArgumentException
 Construct a sub EUI48 via given string representation. More...
 
 EUI48Sub (final byte stream[], final int pos, final int len_)
 Construct instance via given source byte array. More...
 
final boolean equals (final Object obj)
 
final int hashCode ()
 
void clearHash ()
 Method clears the cached hash value. More...
 
void clear ()
 Method clears the underlying byte array b and sets length to zero. More...
 
int indexOf (final EUI48Sub needle)
 Finds the index of given EUI48Sub needle within this instance haystack. More...
 
boolean contains (final EUI48Sub needle)
 Returns true, if given EUI48Sub needle is contained in this instance haystack. More...
 
final String toString ()
 

Static Public Member Functions

static boolean scanEUI48Sub (final String str, final EUI48Sub dest, final StringBuilder errmsg)
 Fills given EUI48Sub instance via given string representation. More...
 
static int indexOf (final byte haystack_b[], final int haystack_length, final byte needle_b[], final int needle_length)
 Find index of needle within haystack. More...
 

Public Attributes

final byte b []
 The EUI48 sub-address, always 6 bytes reserved. More...
 
int length
 The actual length in bytes of the EUI48 sub-address, less or equal 6 bytes. More...
 

Static Public Attributes

static final EUI48Sub ANY_DEVICE = new EUI48Sub( new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }, 0, 6 )
 EUI48Sub MAC address matching any device, i.e. More...
 
static final EUI48Sub ALL_DEVICE = new EUI48Sub( new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, 0, 6 )
 EUI48Sub MAC address matching all device, i.e. More...
 
static final EUI48Sub LOCAL_DEVICE = new EUI48Sub( new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff }, 0, 6 )
 EUI48Sub MAC address matching local device, i.e. More...
 

Detailed Description

A 48 bit EUI-48 sub-identifier, see EUI48.

Definition at line 31 of file EUI48Sub.java.

Constructor & Destructor Documentation

◆ EUI48Sub() [1/3]

org.direct_bt.EUI48Sub.EUI48Sub ( )

Construct empty unset instance.

Definition at line 104 of file EUI48Sub.java.

Here is the caller graph for this function:

◆ EUI48Sub() [2/3]

org.direct_bt.EUI48Sub.EUI48Sub ( final String  str) throws IllegalArgumentException

Construct a sub EUI48 via given string representation.

Implementation is consistent with toString().

Parameters
stra string of less or equal of 17 characters representing less or equal of 6 bytes as hexadecimal numbers separated via colon, e.g.
"01:02:03:0A:0B:0C"
,
"01:02:03:0A"
,
":"
,
""
.
See also
toString()
Exceptions
IllegalArgumentExceptionif given string doesn't comply with EUI48

Definition at line 119 of file EUI48Sub.java.

Here is the call graph for this function:

◆ EUI48Sub() [3/3]

org.direct_bt.EUI48Sub.EUI48Sub ( final byte  stream[],
final int  pos,
final int  len_ 
)

Construct instance via given source byte array.

Definition at line 128 of file EUI48Sub.java.

Member Function Documentation

◆ clear()

void org.direct_bt.EUI48Sub.clear ( )

Method clears the underlying byte array b and sets length to zero.

The cached hash value is also cleared.

See also
clearHash()

Definition at line 184 of file EUI48Sub.java.

Here is the caller graph for this function:

◆ clearHash()

void org.direct_bt.EUI48Sub.clearHash ( )

Method clears the cached hash value.

See also
clear()

Definition at line 178 of file EUI48Sub.java.

◆ contains()

boolean org.direct_bt.EUI48Sub.contains ( final EUI48Sub  needle)

Returns true, if given EUI48Sub needle is contained in this instance haystack.

If the sub is zero, true is returned.

Definition at line 246 of file EUI48Sub.java.

Here is the call graph for this function:

◆ equals()

final boolean org.direct_bt.EUI48Sub.equals ( final Object  obj)

Definition at line 138 of file EUI48Sub.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hashCode()

final int org.direct_bt.EUI48Sub.hashCode ( )

Implementation uses a lock-free volatile cache.

See also
clearHash()

Definition at line 161 of file EUI48Sub.java.

◆ indexOf() [1/2]

static int org.direct_bt.EUI48Sub.indexOf ( final byte  haystack_b[],
final int  haystack_length,
final byte  needle_b[],
final int  needle_length 
)
static

Find index of needle within haystack.

Parameters
haystack_bhaystack data
haystack_lengthhaystack length
needle_bneedle data
needle_lengthneedle length
Returns
index of first element of needle within haystack or -1 if not found. If the needle length is zero, 0 (found) is returned.

Definition at line 199 of file EUI48Sub.java.

Here is the caller graph for this function:

◆ indexOf() [2/2]

int org.direct_bt.EUI48Sub.indexOf ( final EUI48Sub  needle)

Finds the index of given EUI48Sub needle within this instance haystack.

Parameters
needle
Returns
index of first element of needle within this instance haystack or -1 if not found. If the needle length is zero, 0 (found) is returned.

Definition at line 236 of file EUI48Sub.java.

Here is the call graph for this function:

◆ scanEUI48Sub()

static boolean org.direct_bt.EUI48Sub.scanEUI48Sub ( final String  str,
final EUI48Sub  dest,
final StringBuilder  errmsg 
)
static

Fills given EUI48Sub instance via given string representation.

Implementation is consistent with toString().

Parameters
stra string of less or equal of 17 characters representing less or equal of 6 bytes as hexadecimal numbers separated via colon, e.g.
"01:02:03:0A:0B:0C"
,
"01:02:03:0A"
,
":"
,
""
.
destEUI48Sub to set its value
errmsgerror parsing message if returning false
Returns
true if successful, otherwise false
See also
EUI48Sub(String)
toString()

Definition at line 64 of file EUI48Sub.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

final String org.direct_bt.EUI48Sub.toString ( )

Returns the EUI48 sub-string representation, less or equal 17 characters representing less or equal 6 bytes as upper case hexadecimal numbers separated via colon, e.g.

"01:02:03:0A:0B:0C"

,

"01:02:03:0A"

,

":"

,

""

.

Definition at line 259 of file EUI48Sub.java.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ALL_DEVICE

final EUI48Sub org.direct_bt.EUI48Sub.ALL_DEVICE = new EUI48Sub( new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, 0, 6 )
static

EUI48Sub MAC address matching all device, i.e.

'ff:ff:ff:ff:ff:ff'.

Definition at line 35 of file EUI48Sub.java.

◆ ANY_DEVICE

final EUI48Sub org.direct_bt.EUI48Sub.ANY_DEVICE = new EUI48Sub( new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }, 0, 6 )
static

EUI48Sub MAC address matching any device, i.e.

'0:0:0:0:0:0'.

Definition at line 33 of file EUI48Sub.java.

◆ b

final byte org.direct_bt.EUI48Sub.b[]

The EUI48 sub-address, always 6 bytes reserved.

Definition at line 42 of file EUI48Sub.java.

◆ length

int org.direct_bt.EUI48Sub.length

The actual length in bytes of the EUI48 sub-address, less or equal 6 bytes.

Definition at line 49 of file EUI48Sub.java.

◆ LOCAL_DEVICE

final EUI48Sub org.direct_bt.EUI48Sub.LOCAL_DEVICE = new EUI48Sub( new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff }, 0, 6 )
static

EUI48Sub MAC address matching local device, i.e.

'0:0:0:ff:ff:ff'.

Definition at line 37 of file EUI48Sub.java.


The documentation for this class was generated from the following file: