org.rhq.core.domain.cloud.composite
Class FailoverListComposite
java.lang.Object
org.rhq.core.domain.cloud.composite.FailoverListComposite
- All Implemented Interfaces:
- Serializable, Iterator<FailoverListComposite.ServerEntry>
public class FailoverListComposite
- extends Object
- implements Iterator<FailoverListComposite.ServerEntry>, Serializable
- See Also:
- Serialized Form
FailoverListComposite
public FailoverListComposite(List<FailoverListComposite.ServerEntry> servers)
size
public int size()
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<FailoverListComposite.ServerEntry>
next
public FailoverListComposite.ServerEntry next()
- Specified by:
next
in interface Iterator<FailoverListComposite.ServerEntry>
peek
public FailoverListComposite.ServerEntry peek()
- Same as
next()
except this doesn't move the iterator
pointer forward. Calling this method multiple times in a row
results in the same server being returned, unlike next()
.
If you call peek()
and then next()
, both will
return the same server.
- Returns:
- the server entry that is next on the list to be returned (may be null)
get
public FailoverListComposite.ServerEntry get(int index)
resetIndex
public void resetIndex()
- Call this method if you want the iterator to start over at the
first, topmost, server in the failover list.
remove
public void remove()
- Specified by:
remove
in interface Iterator<FailoverListComposite.ServerEntry>
writeAsText
public String writeAsText()
- Used to "serialize" this list in a human-readable form (useful for storing the list
in a text file that humans can read and potentially edit).
- Returns:
- the list in a human readable format
readAsText
public static FailoverListComposite readAsText(String text)
- Factory method that takes text generated from a previous instance's
writeAsText()
string.
- Parameters:
text
- the failover list, in text form
- Returns:
- a new instance of FailoverListComposite whose servers are found in
text
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.