uwcse.location.core
Class Sample

java.lang.Object
  |
  +--uwcse.location.core.Sample

public class Sample
extends Object

A Sample contains a state and an associated importance weight.

Version:
$Revision: 1.3 $
Author:
Jeffrey Hightower

Constructor Summary
Sample()
          Create a new sample with the default state and a weight of 0.
Sample(Sample samp)
          Create a new sample from an existing sample.
Sample(State state)
          Create a new sample with the given State and weight of 1.
Sample(State state, double weight)
          Create a new sample with the given State and weight.
 
Method Summary
 Object clone()
          Overridden to perform a deep copy on the Sample.
 boolean equals(Object o)
          Test for semantic equality to another Sample, that is, the weights are the same and this.getState().equals(samp.getState()) returns true.
 State getState()
          Access the State of this sample
 double getWeight()
          Get the importance weight of this sample.
 void setState(State s)
          Set a new state for this sample.
 void setWeight(double weight)
          Set the importance weight of this sample.
 String toString()
          Return a string representation of this Sample.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sample

public Sample()
Create a new sample with the default state and a weight of 0.


Sample

public Sample(Sample samp)
Create a new sample from an existing sample.


Sample

public Sample(State state)
Create a new sample with the given State and weight of 1.


Sample

public Sample(State state,
              double weight)
Create a new sample with the given State and weight.

Method Detail

clone

public Object clone()
Overridden to perform a deep copy on the Sample.

Overrides:
clone in class Object

getWeight

public double getWeight()
Get the importance weight of this sample.


setWeight

public void setWeight(double weight)
Set the importance weight of this sample.


getState

public State getState()
Access the State of this sample


setState

public void setState(State s)
Set a new state for this sample.


equals

public boolean equals(Object o)
Test for semantic equality to another Sample, that is, the weights are the same and this.getState().equals(samp.getState()) returns true.

Overrides:
equals in class Object

toString

public String toString()
Return a string representation of this Sample.

Overrides:
toString in class Object


This documentation is for the Location Stack v0.8. The latest distribution, the documentation, and the list of contributors to the Location Stack can always be found at http://portolano.cs.washington.edu/projects/location/

© Copyright 2004 University of Washington CSE