Package com.portwise.core.lcp
Class OneValueAttributeList<oneValueAttribute>
- java.lang.Object
-
- com.portwise.core.lcp.OneValueAttributeList<oneValueAttribute>
-
public class OneValueAttributeList<oneValueAttribute> extends java.lang.Object
A holder for a list ofOneValueAttribute
instances.
-
-
Constructor Summary
Constructors Constructor Description OneValueAttributeList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(OneValueAttribute oneValueAttribute)
Appends the specified element to the end of this list.void
clear()
Removes all of the elements from this list.boolean
contains(OneValueAttribute oneValueAttribute)
Returns true if this list contains the specified element.boolean
contains(java.lang.String name)
Returns true if this list containsOneValueAttribute
with the specified name.int
getSize()
java.lang.String
getStringValue(java.lang.String name)
Getter for string values using attribute name.boolean
hasMoreAttributes()
Returns true if there are at least one element in this list.java.util.Iterator<OneValueAttribute>
iterator()
Returns an iterator over the elements in this list (in proper sequence).boolean
remove(java.lang.String name)
Removes an specificOneValueAttribute
.OneValueAttribute
removeFirst()
Removes and returns the first element from this list.int
tlvSize()
Internal method that returns the actual length of the object for sending over LCP.
-
-
-
Method Detail
-
add
public void add(OneValueAttribute oneValueAttribute)
Appends the specified element to the end of this list.- Parameters:
oneValueAttribute
- The element to be appended to this list.
-
hasMoreAttributes
public boolean hasMoreAttributes()
Returns true if there are at least one element in this list. False is returned otherwise.- Returns:
- True if there are at least one element in this list, false otherwise.
-
removeFirst
public OneValueAttribute removeFirst()
Removes and returns the first element from this list.- Returns:
- The first element from this list.
- Throws:
java.util.NoSuchElementException
- If this list is empty.
-
iterator
public java.util.Iterator<OneValueAttribute> iterator()
Returns an iterator over the elements in this list (in proper sequence).- Returns:
- An iterator over the elements in this list (in proper sequence).
-
tlvSize
public int tlvSize()
Internal method that returns the actual length of the object for sending over LCP.- Returns:
- The actual length of the object for sending over LCP.
-
contains
public boolean contains(OneValueAttribute oneValueAttribute)
Returns true if this list contains the specified element. False is returned otherwise.- Parameters:
oneValueAttribute
- Element whose presence in this list is to be tested.- Returns:
- true if this list contains the specified element, false otherwise.
-
contains
public boolean contains(java.lang.String name)
Returns true if this list containsOneValueAttribute
with the specified name. False is returned otherwise.- Parameters:
name
- The name to search for- Returns:
- true if this list contains an
OneValueAttribute
with the specified name, false otherwise.
-
remove
public boolean remove(java.lang.String name)
Removes an specificOneValueAttribute
. Searches by name. Removes the first occurrence.- Parameters:
name
- Name of theOneValueAttribute
to remove- Returns:
- true if the
OneValueAttribute
is found and removed.
-
clear
public void clear()
Removes all of the elements from this list.
-
getStringValue
public java.lang.String getStringValue(java.lang.String name)
Getter for string values using attribute name.- Parameters:
name
-- Returns:
- value as string or null.
-
getSize
public int getSize()
-
-