public class ChannelList extends Object implements Iterable<ChannelList.ChannelListElement>
Modifier and Type | Class and Description |
---|---|
static interface |
ChannelList.ChannelListElement
Helper public interface to iterate over channel data
|
Constructor and Description |
---|
ChannelList() |
Modifier and Type | Method and Description |
---|---|
Collection<Channel> |
channels()
Return a read-only view of the channel descriptions contained in this
channel list.
|
void |
clear()
Removes all the channels from the list.
|
boolean |
containsChannel(String name)
Returns
true if this channel list has a channel with the given
name. |
boolean |
equals(Object obj) |
Channel |
findChannel(String name)
Return a reference to the description of an existing channel with
the given name.
|
Channel |
getChannel(String name)
Return a reference to the description of an existing channel with
the given name.
|
int |
hashCode() |
Channel |
insert(String name,
Channel channel)
Add a channel to the current channel list.
|
boolean |
isEmpty()
Return
true if this channel list does not contain any mappings. |
Iterator<ChannelList.ChannelListElement> |
iterator()
Returns an iterator to the channel elements, that is the tuple of
a channel name and its channel data description.
|
Set<String> |
nameSet()
Return a read-only view of the channels names contained in this channel
list.
|
Channel |
removeChannel(String name)
Remove a channel from the current channel list.
|
int |
size()
Returns the number of channels in this list.
|
String |
toString()
Returns a string representation of this channel list.
|
public Iterator<ChannelList.ChannelListElement> iterator()
iterator
in interface Iterable<ChannelList.ChannelListElement>
public Channel insert(String name, Channel channel)
name
cannot
be empty nor exceed the maximum name length for a given version of
the OpenEXR header; the channel description cannot be null.
Returns the previous channel description associated with that name,
or null
if there was no mapping for the name.
This method inserts a deep-copy of the input channel.
name
- name for the channelchannel
- data description for the channelnull
if there was no mapping for the name.public Channel getChannel(String name) throws IllegalArgumentException
IllegalArgumentException
name
- name associated with the channelIllegalArgumentException
- if there is not such a channelfindChannel(java.lang.String)
public Channel findChannel(String name)
null
.name
- name associated with the channelnull
.getChannel(java.lang.String)
public boolean containsChannel(String name)
true
if this channel list has a channel with the given
name. Thus if this method returns true
, calling
getChannel
with the same channel name will not throw
throw an exception.name
- channel name whose presence is to be tested.true
if this channel list has a channel with the given
namepublic Channel removeChannel(String name)
null
if there was no mapping for the name.name
- name for the channel to removenull
if there was no mapping for the name.public void clear()
public int size()
public boolean isEmpty()
true
if this channel list does not contain any mappings.true
if this channel list does not contain any mappingspublic Set<String> nameSet()
public Collection<Channel> channels()
public String toString()