com.j256.simplemagic.types
Class LocalDateType

java.lang.Object
  extended by com.j256.simplemagic.types.LongType
      extended by com.j256.simplemagic.types.IntegerType
          extended by com.j256.simplemagic.types.LocalDateType
All Implemented Interfaces:
MagicMatcher
Direct Known Subclasses:
LocalLongDateType, UtcDateType

public class LocalDateType
extends IntegerType

A 4-byte value interpreted as a UNIX-style date, but interpreted as local time rather than UTC.

Author:
graywatson

Field Summary
protected  ThreadLocal<SimpleDateFormat> dateFormat
           
 
Fields inherited from class com.j256.simplemagic.types.LongType
endianConverter
 
Constructor Summary
LocalDateType(EndianType endianType)
           
 
Method Summary
protected  void assisgnTimeZone(SimpleDateFormat format)
           
protected  Date dateFromExtractedValue(long val)
           
 void renderValue(StringBuilder sb, Object extractedValue, Formatter formatter)
          Returns the string version of the extracted value.
 
Methods inherited from class com.j256.simplemagic.types.IntegerType
extractValueFromBytes
 
Methods inherited from class com.j256.simplemagic.types.LongType
convertTestString, isMatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dateFormat

protected final ThreadLocal<SimpleDateFormat> dateFormat
Constructor Detail

LocalDateType

public LocalDateType(EndianType endianType)
Method Detail

renderValue

public void renderValue(StringBuilder sb,
                        Object extractedValue,
                        Formatter formatter)
Description copied from interface: MagicMatcher
Returns the string version of the extracted value.

Specified by:
renderValue in interface MagicMatcher
Overrides:
renderValue in class LongType

dateFromExtractedValue

protected Date dateFromExtractedValue(long val)

assisgnTimeZone

protected void assisgnTimeZone(SimpleDateFormat format)


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.