jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
org.jau.net.EUI48Sub Class Reference

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

Collaboration diagram for org.jau.net.EUI48Sub:

Public Member Functions

 EUI48Sub ()
 Construct empty unset instance.
 
 EUI48Sub (final String str) throws IllegalArgumentException
 Construct a sub EUI48 via given string representation.
 
 EUI48Sub (final byte stream[], final int pos, final int len_, final ByteOrder byte_order)
 Copy len_ address bytes from given source and byte order, while converting them to ByteOrder#nativeOrder().
 
final boolean equals (final Object obj)
 
final int hashCode ()
 
void clearHash ()
 Method clears the cached hash value.
 
void clear ()
 Method clears the underlying byte array b and sets length to zero.
 
int indexOf (final EUI48Sub needle, final ByteOrder byte_order)
 Finds the index of given EUI48Sub needle within this instance haystack in the given byte order.
 
boolean contains (final EUI48Sub needle)
 Returns true, if given EUI48Sub needle is contained in this instance haystack.
 
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.
 
static int indexOf (final byte haystack_b[], final int haystack_length, final byte needle_b[], final int needle_length, final ByteOrder byte_order)
 Find index of needle within haystack in the given byte order.
 

Public Attributes

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

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, ByteOrder.LITTLE_ENDIAN )
 EUI48Sub MAC address matching any device, i.e.
 
static final EUI48Sub ALL_DEVICE = new EUI48Sub( new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, 0, 6, ByteOrder.LITTLE_ENDIAN )
 EUI48Sub MAC address matching all device, i.e.
 
static final EUI48Sub LOCAL_DEVICE = new EUI48Sub( new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff }, 0, 6, ByteOrder.LITTLE_ENDIAN )
 EUI48Sub MAC address matching local device, i.e.
 

Detailed Description

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

Stores value in ByteOrder#nativeOrder() byte order.

Definition at line 37 of file EUI48Sub.java.

Constructor & Destructor Documentation

◆ EUI48Sub() [1/3]

org.jau.net.EUI48Sub.EUI48Sub ( )

Construct empty unset instance.

Definition at line 116 of file EUI48Sub.java.

Here is the caller graph for this function:

◆ EUI48Sub() [2/3]

org.jau.net.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 131 of file EUI48Sub.java.

Here is the call graph for this function:

◆ EUI48Sub() [3/3]

org.jau.net.EUI48Sub.EUI48Sub ( final byte stream[],
final int pos,
final int len_,
final ByteOrder byte_order )

Copy len_ address bytes from given source and byte order, while converting them to ByteOrder#nativeOrder().

Parameters
streamaddress bytes
posposition in stream at address
len_number of address bytes
byte_orderByteOrder#LITTLE_ENDIAN or ByteOrder#BIG_ENDIAN byte order of given address bytes, one may pass ByteOrder#nativeOrder().

Definition at line 148 of file EUI48Sub.java.

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void org.jau.net.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 208 of file EUI48Sub.java.

Here is the caller graph for this function:

◆ clearHash()

void org.jau.net.EUI48Sub.clearHash ( )

Method clears the cached hash value.

See also
clear()

Definition at line 202 of file EUI48Sub.java.

◆ contains()

boolean org.jau.net.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 289 of file EUI48Sub.java.

Here is the call graph for this function:

◆ equals()

final boolean org.jau.net.EUI48Sub.equals ( final Object obj)

Definition at line 162 of file EUI48Sub.java.

Here is the call graph for this function:

◆ hashCode()

final int org.jau.net.EUI48Sub.hashCode ( )

Implementation uses a lock-free volatile cache.

See also
clearHash()

Definition at line 185 of file EUI48Sub.java.

◆ indexOf() [1/2]

static int org.jau.net.EUI48Sub.indexOf ( final byte haystack_b[],
final int haystack_length,
final byte needle_b[],
final int needle_length,
final ByteOrder byte_order )
static

Find index of needle within haystack in the given byte order.

The returned index will be adjusted for the desired byte order.

Parameters
haystack_bhaystack data
haystack_lengthhaystack length
needle_bneedle data
needle_lengthneedle length
byte_orderbyte order will adjust the returned index, ByteOrder#BIG_ENDIAN is equivalent with toString() representation from left (MSB) to right (LSB).
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 229 of file EUI48Sub.java.

Here is the caller graph for this function:

◆ indexOf() [2/2]

int org.jau.net.EUI48Sub.indexOf ( final EUI48Sub needle,
final ByteOrder byte_order )

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

The returned index will be adjusted for the desired byte order.

Parameters
needle
byte_orderbyte order will adjust the returned index, ByteOrder#BIG_ENDIAN is equivalent with toString() representation from left (MSB) to right (LSB).
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.
See also
indexOf(byte[], int, byte[], int, ByteOrder)

Definition at line 279 of file EUI48Sub.java.

Here is the call graph for this function:

◆ scanEUI48Sub()

static boolean org.jau.net.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 70 of file EUI48Sub.java.

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

◆ toString()

final String org.jau.net.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 302 of file EUI48Sub.java.

Here is the call graph for this function:

Member Data Documentation

◆ ALL_DEVICE

final EUI48Sub org.jau.net.EUI48Sub.ALL_DEVICE = new EUI48Sub( new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, 0, 6, ByteOrder.LITTLE_ENDIAN )
static

EUI48Sub MAC address matching all device, i.e.

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

Definition at line 41 of file EUI48Sub.java.

◆ ANY_DEVICE

final EUI48Sub org.jau.net.EUI48Sub.ANY_DEVICE = new EUI48Sub( new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }, 0, 6, ByteOrder.LITTLE_ENDIAN )
static

EUI48Sub MAC address matching any device, i.e.

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

Definition at line 39 of file EUI48Sub.java.

◆ b

final byte org.jau.net.EUI48Sub.b[]

The EUI48 sub-address, always 6 bytes reserved.

Definition at line 48 of file EUI48Sub.java.

◆ length

int org.jau.net.EUI48Sub.length

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

Definition at line 55 of file EUI48Sub.java.

◆ LOCAL_DEVICE

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

EUI48Sub MAC address matching local device, i.e.

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

Definition at line 43 of file EUI48Sub.java.


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