public class MjBatteryReceiver extends java.lang.Object implements IMjReceiver, IMjReadable
Constructor and Description |
---|
MjBatteryReceiver(MjBattery battery) |
Modifier and Type | Method and Description |
---|---|
boolean |
canConnect(IMjConnector other)
Checks to see if this connector can connect to the other connector.
|
long |
getCapacity() |
long |
getPowerRequested() |
long |
getStored() |
long |
receivePower(long microJoules,
boolean simulate)
Receives power.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canReceive
public MjBatteryReceiver(MjBattery battery)
public boolean canConnect(@Nonnull IMjConnector other)
IMjConnector
canConnect
in interface IMjConnector
public long getPowerRequested()
getPowerRequested
in interface IMjReceiver
public long receivePower(long microJoules, boolean simulate)
IMjReceiver
MjBattery
for later usage.
MjBattery
is full).
IMjReceiver.canReceive()
before calling this - implementors should check
all of the conditions in IMjReceiver.canReceive()
before accepting power.receivePower
in interface IMjReceiver
microJoules
- The number of micro joules to add.simulate
- If true then just pretend you received power- don't actually change any of your internal state.public long getStored()
getStored
in interface IMjReadable
public long getCapacity()
getCapacity
in interface IMjReadable