All pastes #2089919 Raw Edit

Stuff

public text v1 · immutable
#2089919 ·published 2011-10-14 04:28 UTC
rendered paste body
package prologtest;
import java.util.Map;

import jpl.Compound;
import jpl.Term;
import jpl.fli.term_t;

// c class wraps a prolog term in functions to access the bitstring values by friendly name--update it when the .pl file changes!
public class PrologBitstring implements Comparable<Object> {
	
	int i = 1;
	
	Term c;

	// don't construct these yourself, get them from prolog and cast to Bitstring Term!
	public PrologBitstring(Term c) {
		this.c = c;		

	}
	
	
	public Object bitString(){
		return c.arg(1).intValue();
	}
	
	public int numThinLeaves(){
		return c.arg(2).intValue();
	}
	
	public int numAttacks(){
		return c.arg(3).intValue();
	}
	
	public boolean isBeatInitial(){
		return (c.arg(4).intValue()  == 1);
	}
	
	public boolean isIsochronous(){
		return (c.arg(5).intValue() == 1);
	}
	
	public int numUniqueDurations(){
		return c.arg(7).intValue();
	}
	
	public int durationUpcount(){
		return c.arg(8).intValue();
	}
	
	public int durationStaycount(){
		return c.arg(9).intValue();
	}
	
	public int durationDowncount(){
		return c.arg(10).intValue();
	}


	@Override
	public int compareTo(Object o) {
		i++;
		// TODO Auto-generated method stub
		return 0; 
	}


	
	

}