Josh
Native console access wrapper for Java

com.yifanlu.Josh
Class ConsoleHistoryInfo

java.lang.Object
  extended by com.yifanlu.Josh.ConsoleHistoryInfo

public class ConsoleHistoryInfo
extends java.lang.Object

Contains information about the console history.

Since:
0.1
Version:
1.3, 05/29/10
Author:
Yifan Lu
See Also:
Windows' CONSOLE_HISTORY_INFO structure, Josh.getConsoleHistoryInfo(), Josh.setConsoleHistoryInfo(com.yifanlu.Josh.ConsoleHistoryInfo)

Field Summary
static int HISTORY_NO_DUP_FLAG
          Flag value: Duplicate entries will not be stored in the history buffer.
 
Constructor Summary
ConsoleHistoryInfo(int historyBufferSize, int numberOfHistoryBuffers, int flags)
          Creates a new console history infomation.
 
Method Summary
 boolean equals(java.lang.Object anObject)
          Compares two Objects, if both are ConsoleHistoryInfo and have the same values, they are equal.
 int getFlags()
          Gets the history buffer flags.
 int getHistoryBufferSize()
          Gets the size of the history buffer.
 int getNumberOfHistoryBuffers()
          Gets the number of history buffers.
 int hashCode()
          Returns a hash code.
 void setFlags(int flags)
          Sets the history buffer flags.
 void setHistoryBufferSize(int historyBufferSize)
          Sets the size of the history buffer.
 void setNumberOfHistoryBuffers(int numberOfHistoryBuffers)
          Sets the number of history buffers.
 java.lang.String toString()
          A String representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HISTORY_NO_DUP_FLAG

public static final int HISTORY_NO_DUP_FLAG
Flag value: Duplicate entries will not be stored in the history buffer.

See Also:
Constant Field Values
Constructor Detail

ConsoleHistoryInfo

public ConsoleHistoryInfo(int historyBufferSize,
                          int numberOfHistoryBuffers,
                          int flags)
Creates a new console history infomation.

Parameters:
historyBufferSize - The number of commands kept in each history buffer.
numberOfHistoryBuffers - The number of history buffers kept for this console process.
flags - Set using constants defined in this class.
Method Detail

getHistoryBufferSize

public int getHistoryBufferSize()
Gets the size of the history buffer.

Returns:
The number of commands kept in each history buffer.

getNumberOfHistoryBuffers

public int getNumberOfHistoryBuffers()
Gets the number of history buffers.

Returns:
The number of history buffers kept for this console process.

getFlags

public int getFlags()
Gets the history buffer flags. Compare with the constants in this class.

Returns:
The flags as an int.

setHistoryBufferSize

public void setHistoryBufferSize(int historyBufferSize)
Sets the size of the history buffer.

Parameters:
historyBufferSize - The number of commands kept in each history buffer.

setNumberOfHistoryBuffers

public void setNumberOfHistoryBuffers(int numberOfHistoryBuffers)
Sets the number of history buffers.

Parameters:
numberOfHistoryBuffers - The number of history buffers kept for this console process.

setFlags

public void setFlags(int flags)
Sets the history buffer flags. Use the constants in this class.

Parameters:
flags - The flags as an int.

equals

public boolean equals(java.lang.Object anObject)
Compares two Objects, if both are ConsoleHistoryInfo and have the same values, they are equal.

Overrides:
equals in class java.lang.Object
Parameters:
anObject - Another ConsoleHistoryInfo object.
Returns:
true if all values are equal.

hashCode

public int hashCode()
Returns a hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.

toString

public java.lang.String toString()
A String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The history buffer size, the number of history buffers, and the flags

Copyright © 2010 Yifan Lu