|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrbrain.PoseSequence
public class PoseSequence
Sequence of Bioloid Pose
s.
A pose sequence may have zero poses but always has an immutable pose format, to which all added poses must adhere.
The sequence is both iterated and mutated via ListIterators acquired from
the listIterator()
methods.
Copyright (C) 2007 Marsette A. Vona, III
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Field Summary | |
---|---|
int[] |
axIDs
the set of axIDs; do not mutate |
private static java.lang.String |
cvsid
|
protected Pose |
formatPose
a dummy pose giving the format |
protected java.util.LinkedList<Pose> |
poses
the poses |
int |
readNum
the number of regs in the BRBrain read format |
AXRegister |
readStart
the first reg in the BRBrain read format |
AXRegister[] |
registers
the set of registers; do not mutate |
int |
writeNum
the number of regs in the BRBrain write format, or 0 if none |
AXRegister |
writeStart
the first reg in the BRBrain write format, or null if none |
Constructor Summary | |
---|---|
PoseSequence(int[] axIDs,
AXRegister[] registers,
AXRegister writeStart,
int writeNum)
make a new empty sequence with the given format |
Method Summary | |
---|---|
protected void |
checkPose(Pose p)
make sure that a pose has the correct format |
Pose |
getFirst()
get the first pose in the sequence, NoSuchElement exception if empty |
Pose |
getLast()
get the last pose in the sequence, NoSuchElement exception if empty |
boolean |
isEmpty()
check if the sequence is empty |
java.util.ListIterator<Pose> |
listIterator()
get an iterator |
java.util.ListIterator<Pose> |
listIterator(int index)
get an iterator starting at the given zero-based index |
void |
readFrom(java.io.InputStream is)
covers readFrom(Pose.PoseTokenizer) , conses the tokenizer |
void |
readFrom(Pose.PoseTokenizer t)
Clear current sequence and read all poses in the format Pose.readFrom(brbrain.Pose) expects. |
int |
size()
get the number of poses in the sequence |
protected java.util.ListIterator<Pose> |
wrapIterator(java.util.ListIterator<Pose> it)
wrap a vanilla iterator with format checking and setting |
void |
writeHeaderTo(java.io.OutputStream s)
covers writeHeaderTo(PrintWriter) |
void |
writeHeaderTo(java.io.PrintWriter w)
write a header comment with the axIDs |
void |
writeTo(java.io.OutputStream s)
covers writeTo(PrintWriter) |
void |
writeTo(java.io.PrintWriter w)
write all poses in the format readFrom(brbrain.Pose.PoseTokenizer) expects |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String cvsid
public final int[] axIDs
public final AXRegister[] registers
public final AXRegister readStart
BRBrain
read format
public final AXRegister writeStart
BRBrain
write format, or null if none
public final int readNum
BRBrain
read format
public final int writeNum
BRBrain
write format, or 0 if none
protected Pose formatPose
protected java.util.LinkedList<Pose> poses
Constructor Detail |
---|
public PoseSequence(int[] axIDs, AXRegister[] registers, AXRegister writeStart, int writeNum)
Method Detail |
---|
public java.util.ListIterator<Pose> listIterator()
public java.util.ListIterator<Pose> listIterator(int index)
protected java.util.ListIterator<Pose> wrapIterator(java.util.ListIterator<Pose> it)
protected void checkPose(Pose p)
public int size()
public boolean isEmpty()
public Pose getFirst()
public Pose getLast()
public void readFrom(Pose.PoseTokenizer t) throws java.io.IOException
Clear current sequence and read all poses
in the format Pose.readFrom(brbrain.Pose)
expects.
java.io.IOException
public void readFrom(java.io.InputStream is) throws java.io.IOException
readFrom(Pose.PoseTokenizer)
, conses the tokenizer
java.io.IOException
public void writeTo(java.io.PrintWriter w) throws java.io.IOException
poses
in the format readFrom(brbrain.Pose.PoseTokenizer)
expects
java.io.IOException
public void writeTo(java.io.OutputStream s) throws java.io.IOException
writeTo(PrintWriter)
java.io.IOException
public void writeHeaderTo(java.io.PrintWriter w) throws java.io.IOException
java.io.IOException
public void writeHeaderTo(java.io.OutputStream s) throws java.io.IOException
writeHeaderTo(PrintWriter)
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |